From Lotus Script you can create a Word object - see this blog entry
Then you can fill it with data from your Notes Document and just save it as an PDF document
The easiest way to make the script, is to record a macro in Word and the convert the code to Lotus Script.
This line is from a Word macro, and show how to save the current document as a PDF file:
ActiveDocument.ExportAsFixedFormat OutputFileName:= "c:\temp\sample.pdf", ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:=wdExportOptimizeForPrint, Range:= wdExportAllDocument, From:=1, To:=1, Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, CreateBookmarks:= wdExportCreateNoBookmarks, DocStructureTags:=True, BitmapMissingFonts:=True, UseISO19005_1:=False
To convert it to Lotus Script you need to translate all the constants to a value (and remove the parameter label).
To convert: In the Visual Basic editor, just right click on a constant - then select 'Quick Info' Or you can find all the constants in this database
Note - you can skip the last parameters if you don't need them (using defaults)
The converted script will look like this
yourwordobject.ActiveDocument.ExportAsFixedFormat "c:\temp\sample.pdf", 17, false, 0, 0
Friday, September 18, 2009
Learning Java
The PDF 'Writing Java to build applications using IBM Lotus Domino Designer' gives a good introduction to Java -> http://www.ibm.com/developerworks/lotus/documentation/d-ls-javaapps/
Thursday, February 12, 2009
LotusScript version of KillNotes
Paste the code below into a button - then you have a simple 'Click to kill' feature :-)
Works in both 7.02 and 8.5....
Sub Click(Source As Button)
Dim a As Variant
a = Split( "", "#" )
a = Arrayappend( a, getData())
End Sub
Function getData() As Variant
Exit Function
End Function
Works in both 7.02 and 8.5....
Sub Click(Source As Button)
Dim a As Variant
a = Split( "", "#" )
a = Arrayappend( a, getData())
End Sub
Function getData() As Variant
Exit Function
End Function
Sunday, February 8, 2009
Best Practice: How to reference another database
To do a lookup or search in another database, you need the filename or the replica id.
ReplicaId vs. filename?
- With the replica id, you don't know wich server you end up using. You can provide a hint server - but Notes will often just use the top most bookmark (and this could be the server in singapore)
- Replica ID's is hard to maintain. If you have a developer, test and production version af the database - you need 3 different replica id's.. If you forget to change the replica if when moving to production, user will still use the test database...
- If you use a filename, then the database must have the same filename on all servers and local replica (or you must maintain a complete list) In real life this is not a big issue, as most databases will be deployed using the AdminP or Policies (and therfor have the same filename)
Based on this, I allways use the extact server+filename of the database
Where to store the information?
The filename of the lookup database, can be stored in a profile document or in some keyword documents in the source database. The approach has some problems:
- Typically you dont specify a servername - you use db.server or @subset( @dbname; 1 ) to use the current server. This will be correct in most locations - but in some locations you have both a mail server and an application server. In this senario you cant use the current server to make a lookup from a mail file to a project database.
- Speaking of mail files - you want to make as few design changes a possible to the standard template (so extra profile documents is not pleasent)
- Maintenaince: Sometimes it can be nessesary to move a lookup database - or to change the design. If the database is moved you have to update the profile documents in all databases. But which database did use this lookup database?
The solution is simple: create a central database where you can registre all your lookup databases. Give every reference document an unique id - and give the central database a fixed filename. You will have to make an extra dblookup by the id to find the actual database - but you will also get:
- Central maintenaince
- A great overview of all lookup databases
- You can easily move or rename the lookup database
I use my own DbConfig database for this. You are welcome to download it and use it - it's free
In the DbConfig database I have added some extra functionality
- Every lookup will leave a tracking document. In the usage view, you can see all source databases (So, to answer the question: "Which databases makes use of xxx?" - just look in the usage view)
- You can create expections, like: on all servers, except MAIL01 you should use the currentserver - from MAIL01 you will find the application on APP01
- You can make relative references (to find the lookup database relative to the current directory)
- You can have multiple dbConfig databases on the server. Lookup code will use the nearest (the one in the same directory as the source database. If not found here, it will use the dbconfig in the root...)
Friday, February 6, 2009
Error: "Unable to Bind port 80, port may be in use or user needs net_privaddr privilege"
My Notes server is running on a small XP machine. Notes 7.x and 8.02 worked fine. Upgradring to 8.5 gave me this error message: "Unable to Bind port 80, port may be in use or user needs net_privaddr privilege" when trying to start the HTTP process.
Problem caused by the antivirus. Both AVG and AVAST made the Domino 8.5 HTTP task fail - but it works with COMODO ..
Problem caused by the antivirus. Both AVG and AVAST made the Domino 8.5 HTTP task fail - but it works with COMODO ..
Disclaimer: This e-mail and any attachments are legally privileged and confidential and for the use of the addressee only. If you are not the intended recipient, please notify us imme-diately and delete this e-mail. Unauthorised use, disclosure, copying of the contents of this e-mail, or any similar action, is prohibited |
Rare error message...
Thursday, February 5, 2009
Exporting embedded images
To export an embedded image to must DXL. The image will be enclosed in <jpeg> or <gif> tags in the DXL file. The document can be exported with the NotesDXLExporter - then you can extract the image data by searching for the image tags.
Before saving the file it must be decoded to a binary format. This is easy with the libBase64 librart created by Martin Wendt
A sample can be found in this database: sample file (with some quick'dirty code - but it works...)
Subscribe to:
Posts (Atom)


