Read about a simple solution that enables you to define site structures in IBM® Lotus® Web Content Management in an automated fashion. This solution allows you to save time on an otherwise time-consuming and monotonous task.
Generating PDF documents on the fly isn't exactly rocket science and - with the help of tools like iText - is easily done in Java and something I've talked about before.
The trouble is that creating them is a cumbersome and often tedious task if what you want is anything other than a set of plain text paragraphs added in series. Unlike creating HTML everything in PDF-land is of absolute size and position. I find that getting the result you want is often a case of repetitive, pixel by pixel tweaking to get it right. You need a lot of patience.
If you had a complicated document to create with logos and background images then you're in for a rough ride. What would make more sense is to use a GUI tool to author a base template and then just have your code add the text bits where necessary. This is the situation I found myself in recently and after a bit of digging I worked out how to take an existing PDF and add to it. PDF templating if you will.
Creating a Template
First thing to do, assuming you've not already been provided with a template is to create one. Let's look at creating a letter head. I did this in Word, as you can see below and simply pasted in some images, moved them about and added some company details to the footer in an off grey colour.
Once I was happy with it I used the File - Save As - PDF menu option to save the file in PDF format.
What I did with the PDF is attached it to a document in the same Notes database as we're generating the PDFs from. In reality I had been provided with a PDF template by my client's design agency, so that's what I attached. I could skip the bit above about creating a template, but went through it here in case you need help or inspiration.
The idea behind adding it as an attachment to a document is that the client has control over the template and can change it as and when they please. That being another benefit of this approach - if they happened to change the design of the letterhead then I'd have to go back to messing with the code each time. With this approach there should be no need to.
All we need to do now is add the actual content. Here's an example of what the generated PDF looks like once we've done adding to it with our own code:
Let's look at how we'd do that.
Adding To The Template
The code below is the Java needed to create a new PDF document, import the existing template and then add our own text atop of it.
//Setup a new PDF Document
Document document = new Document();
ByteArrayOutputStream os = new ByteArrayOutputStream(); PdfWriter writer = PdfWriter.getInstance(document, os); document.open();
document.newPage(); //Get the template PDF as the starting point!
View files = db.getView("files");
lotus.domino.Document filestore = settings.getDocumentByKey("pdf_template.pdf", true); String filename = filestore.getItemValueString("FileName"); EmbeddedObject file = filestore.getAttachment(filesname);
InputStream is = file.getInputStream(); //Here's the key part. Let's turn the template in to//usable PDF object
PdfReader reader = new PdfReader(is);
PdfImportedPage page = writer.getImportedPage(reader, 1); //Now, add it to the blank PDF document we've opened
PdfContentByte cb = writer.getDirectContent();
cb.addTemplate(page, 0, 0); //Now do the usual addition of text atop the template
document.add(new Paragraph("Here some text added to the template"));
//Etc, etc//Done!
document.close(); //Tidy up
is.close();
file.recycle(); //Make SURE you do this!!!//Attach the resuling PDF to the Notes document
Stream stream = session.createStream();
stream.write(os.toByteArray()); MIMEEntity m = doc.createMIMEEntity("Files"); MIMEHeader header = m.createHeader("content-disposition");
header.setHeaderVal("attachment;filename=\""+filename+"\""); m.setContentFromBytes(stream, "application/pdf", MIMEEntity.ENC_IDENTITY_BINARY); m.decodeContent();
Code's boring though. What you want is a demo and a download, no?
Start here to find the tutorials, courses, and certification guides you need to stay up-to-date with Lotus Software products and to keep your skills top notch.
XPages is a completely new approach to developing IBM Lotus Domino applications. It simplifies many heretofore difficult and tedious development tasks and adds powerful new capabilities. Find out how to work with XPages in Domino Designer 8.5 and discover the power of server-side JavaScript, which lets you work with the back-end Domino Java classes without having to know Java.
А то какой смысл таскать с собой 3 кг ноутбук с dual-pro-cores и мощным видеоадаптером, если уставшей батарейки хватает на пару часов, видеокарточка просто жрет энергию, Windows загружается минут 10 и тормозит, а dual-core процессор убивается всякими ненужными Office 7 и LotusNotes монстрами?
With version 8.0, a database option was added to let you tell the server's view-indexing process to skip that database. This is handy, but it would also be nice to have such an option on the view level. ...
Здравствуйте, товарищи!! Интересуюсь вот таким вопросом: у меня есть агент,который запускает метод в стороннем web-service. Для связи с web-service я использую Soap-Toolkit.
Но при отработке агента возн7икает ошибка ,что ProjectName missing. Не подскажите в чём проблема ????
вот код вызываемого агента:
Dim Connector As Variant, Serializer As Variant, Reader As Variant Set Serializer =createobject("MSOSOAP.SoapSerializer30") Set connector =createobject("MSOSOAP.HttpConnector30") Set xmldom=createobject ("Msxml2.DOMDocument.5.0") Set reader=createobject ("MSOSOAP.SoapReader30") Set Client =CreateObject("MSOSOAP.SoapClient30") Call Client.mssoapinit (wsdllink) Connector.Property("EndPointURL") = wsdllink Print "задаём логин и пароль пользователя,под которым идёт обращение" 'client.ConnectorProperty("AuthUser") = "pbrfilesinout" 'client.ConnectorProperty("AuthPassword") = ",jcchtathtyn" 'Client.ConnectorProperty("WinHTTPAuthScheme") = 1 Print "Коннектимся к сервису" Call Connector.Connect ' Connector.Property("SoapAction") = "CeatePWA"
Connector.EndMessage errh =Client.FaultString If errh <> "" Then Print "Ошибка" +errh End If Print "Читаем исходящий поток" Reader.Load Connector.OutputStream Print "проверка на наличие ошибок" If Not ( Reader.faultstring Is Nothing)Then Print "нашли ошибку при отработке сервиса" Print Cstr( Reader.faultstring.text ) Else Print " Смотрим результаты работы" ' Msgbox (reader.RPCResult.text) Msgbox Reader.DOM.xml End If
Read about a simple solution that enables you to define site structures in IBM® Lotus® Web Content Management in an automated fashion. This solution allows you to save time on an otherwise time-consuming and monotonous task.
Lotus Notes Developer
Reston, VA L-3 Communications Services Group, Intelligence Solutions Division has an opening for a Lotus Notes Developer in Reston, VA.
Clearance: Must have current TS/SCI FULL ...
Lotus Notes Developer Full Time Regular posted 10/13/2009 Job Category MIS - Info Tech / Telecommunications
Req ID 158730
Able to obtain security clearance? None
Currently possess ...
Lotus Notes Developer Full Time Regular posted 10/16/2009 Job Category MIS - Info Tech / Telecommunications
Req ID 159027
Able to obtain security clearance? None
Currently possess ...
Lotus Notes Developer (CF) Full Time Regular posted 4/6/2009 Job Category MIS - Info Tech / Telecommunications
Req ID 144349
Able to obtain security clearance? None
Currently posse...
Lotus Notes Developer Full Time Regular posted 10/14/2009 Job Category MIS - Info Tech / Telecommunications
Req ID 158834
Able to obtain security clearance? None
Currently possess ...
Lotus Notes Developer - (US-DC-Washington)
Compensation:$20.00 - $36.00 / Hour
Minimum Education:High School
Job Type:Contract
Jobcode:LotusNotes
Email this job to yourself or to a friend|Job Match Te...
Title: Lotus Notes/ Domino Developer 3
Category: Information Systems
Location: Reston, VA / USA | Sector: Information Systems Posting ID: MS/093602
This job is eligible for theRefer a Friendprogram...
Title: Lotus Notes Tier 2 Administrator
Category: Information Systems
Location: Reston, VA / USA | Sector: Information Systems Posting ID: MS/093608
This job is eligible for theRefer a Friendprogra...
Lotus Notes itself offers many cool and useful drag and drop actions. I've been showing end users some of these for a long time, and always there are folks that had no clue drag and drop actions were even available. I wanted to share a few of them with you now.
OpenNTF is devoted to enabling groups of individuals all over the world to collaborate on IBM Lotus Notes/Domino applications and release them as open source.
"Красные книги" IBM Книги компании IBM по специализированным тематикам о Lotus Software. Основной язык - английский форматы pdf и html
Книги компании "Интертраст" Для администраторов разработчиков и пользователей. Настройка и администрирование, разработка и программирование, пользование системой Lotus Notes
Документация. YellowBook Оригинальная документация по продуктам Lotus Software. Язык англыйский. Форматы pdfhtml nsf
IBM Пресс Книги от компании IBM. Книги и брошуры на заказ и на бесплатную скачку в формате pdf
КУДИЦ-ПРЕСС Просмотр и заказ книг. Некоторые книги возможно скачать в формате pdf для свободно чтения и просмотра.