Some of you might be interested in using the Debenu Free PDF Library Lite to create PDF documents or Convert images to Pdf. Which allow you to install the LICENSED SOFTWARE on any number of computers, for any number of developers for both personal or commercial use. (http://www.debenu.com/products/development/debenu-pdf-library-lite/)
Check the license agreement before you install it, as the license agreement could have changes while you are reading this
When you download the software. Read the GettingStarted.pdf file which explains howto registering the ActiveX DLL. And the “Debenu Quick PDF Library 11.12 Reference Guide.pdf” will explain howto use the Library.
Attached two examples:
Create a PDF document with text: “Hello from XOJO”
// Create a PDF document with text: "Hello from XOJO"
Dim PDFLibrary As OLEObject
Dim Stf as Integer
Dim PdfFile As String
PdfFile = "C:\\TEMP\\PDF\\HelloFromXojo.pdf"
PDFLibrary = NEW OLEObject("DebenuPDFLibraryLite1112.PDFLibrary")
PDFLibrary.DrawText(100, 500, "Hello from XOJO")
Stf = PDFLibrary.SaveToFile(PdfFile)
//Stf = 0 "The file could not be created", Stf = 1 "The file was created successfully"
If Stf = 0 Then
MsgBox ("Could not save the PDF file: "+pdfFile)
End If
PDFLibrary = Nil
exception err as oleexception
msgbox err.message
Import image to pdf
// Import image to pdf
Dim PDFLibrary As OLEObject
Dim Stf as Integer
Dim ImageFile, OutPutFile As String
Dim IWidth, IHeight As Integer
ImageFile = "C:\\TEMP\\PDF\\Xojo_images.jpg"
OutPutFile = "C:\\TEMP\\PDF\\ImagetoPdf.pdf"
PDFLibrary = NEW OLEObject("DebenuPDFLibraryLite1112.PDFLibrary")
//Add Image
PDFLibrary.AddImageFromFile( ImageFile, 0 )
// Get the width and height of the image
IWidth = PDFLibrary.ImageWidth
IHeight = PDFLibrary.ImageHeight
// Set new document page size
PDFLibrary.SetPageDimensions( IWidth, IHeight )
// Draw the image onto the page using the the images
// height and width. The image will be drawn in the
// top right hand corner of the page.
PDFLibrary.DrawImage( 0, PDFLibrary.PageHeight, IWidth, IHeight )
// Save the new document
Stf = PDFLibrary.SaveToFile( OutPutFile )
//Stf = 0 "The file could not be created", Stf = 1 "The file was created successfully"
If Stf = 0 Then
MsgBox ("Could not save the PDF file: "+OutPutFile )
End If
PDFLibrary = Nil
exception err as oleexception
msgbox err.message
John, If I am not mistaken, the image functionality is only working with the full version of Debenu.
In any case, in a test program, I use this function to load an image file from a location on my computer:
dim LogoFile as string
dim posX as Double ' variables de positionnement sur la page
dim posY as double
logoFile = "c:\\temp\\LogoMSM2013.jpg" 'attention valeur hardcode corriger
retval = QP.addImageFromFile (LogoFile,0)
posx = .5
posY = .375
retval = QP.drawimage(posX,posY,1.25,1.25)
re-read the post. so, images work with the free version. You will however need the paid version to control fonts and a number of other features. Quite a nice tool.
These are some of the key functions in this free PDF SDK. A full list of functions can be found in the Appendix C: Functions available in the Lite Edition section found in the Function Reference provided with the installer.
Load existing PDFs or generate new ones
Add images to existing PDF files and convert images to PDF files (JPG, GIF, TIFF, PNG, BMP, etc)
Add text and control location, size, color and font
Generate QR codes and add them to PDF files
Merge PDF files together
Set and get document properties (title, author, subject, keyword)
Add web links and set base URL
Get page rotation information and rotate pages
Get security info such as encryption strength and document permissions
Set and get PageBox info (MediaBox, CropBox, BleedBox, TrimBox, ArtBox)
Check for fonts, count embedded images, get page width and height
The Library also exist for: Mac OS X 10.5 to 10.9 (32-bit) I don’t have a Mac so I have no examples for that platform.
As I cannot post anymore in longer threads, I’ll post the answer for Gerardo’s OS X / dylib question here:
I think the dylib you downloaded cannot be used through declares as it seems it is intended for static linking into an Objective C project.