How to create multiple page PDF from multiple images
How to create multiple page PDF from multiple images
Hi Loïc!
Can you show a sample code?
Thanks,
Irab
Can you show a sample code?
Thanks,
Irab
Re: How to create multiple page PDF from same PNG files
Hi
It is a possible way to create multiple page PDF from some files:
How can I do it else simplier?
Regards,
Irab
It is a possible way to create multiple page PDF from some files:
Code: Select all
nImageID = imiPDF.TiffCreateMultiPageFromFile("file1.jpg")
imiPDF.TiffAppendPageFromFile(nImageID, "file2.jpg")
imiPDF.TiffAppendPageFromFile(nImageID, "file3.jpg")
imiPDF.CreateImageFromFile("multipage_tif.tif")
Call imiPDF.PdfCreateFromMultipageTIFF(nImageID, "multipage.pdf")
imiPDF.CloseImage(nImageID)
Regards,
Irab
Re: How to create multiple page PDF from multiple images
Hi,
You can optimize your code like that:
Best regards,
Loïc
You can optimize your code like that:
Code: Select all
Dim nCpt As Long
Dim nImageCount As Long
Imaging1.PdfNewPdf ("multipage.pdf")
Imaging1.PdfAddImageFromFile ("image1.jpg")
Imaging1.PdfAddImageFromFile ("image2.jpg")
Imaging1.PdfAddImageFromFile ("image3.jpg")
nImageCount = 3
For nCpt = 1 To nImageCount
Call Imaging1.PdfSetPageDimensions(Imaging1.PdfGetImageWidth(nCpt), Imaging1.PdfGetImageHeight(nCpt))
Call Imaging1.PdfNewPage
Call Imaging1.PdfDrawImage(nCpt, 0, 0, Imaging1.PdfGetImageWidth(nCpt), Imaging1.PdfGetImageHeight(nCpt))
Call Imaging1.PdfEndPage
Next nCpt
Imaging1.PdfSavePdf
Loïc
Re: How to create multiple page PDF from multiple images
Hi there...
I'm using the following in my (C#) project...
But I'm only ending up with single page pfd files...
I know 'iCount' is 2 or 3 sometimes... so I guess there must be else going wrong...
Any ideas?
I'm using the following in my (C#) project...
Code: Select all
oImaging.PdfNewPdf(sFileName,...);
if (File.Exists(...) == true)
{
oImaging.PdfAddImageFromFile(...);
iCount += 1;
}
sImageCounter = iCount.ToString();
for (var i = 1; i < iCount; i++)
{
oImaging.PdfSetCompressionLevel(8);
oImaging.PdfSetPageDimensions(oImaging.PdfGetImageWidth(i), oImaging.PdfGetImageHeight(i));
oImaging.PdfNewPage();
oImaging.PdfDrawImage(i, 0, 0, oImaging.PdfGetImageWidth(i), oImaging.PdfGetImageHeight(i));
oImaging.PdfEndPage();
}
oImaging.PdfSavePdf();
I know 'iCount' is 2 or 3 sometimes... so I guess there must be else going wrong...
Any ideas?
Re: How to create multiple page PDF from multiple images
Hi,
Your code seems to be good.
Are you using the last edition ? I fixed a problem with image management in a previous release.
Best regards,
Loïc Carrère
Your code seems to be good.
Are you using the last edition ? I fixed a problem with image management in a previous release.
Best regards,
Loïc Carrère
Re: How to create multiple page PDF from multiple images
Ok... using 1.6.0.0 now.
But my problem was caused by the following line:
But my problem was caused by the following line:
which should've been:for (var i = 1; i < iCount; i++)
Still... thanks for the reply Loïc!for (var i = 1; i <= iCount; i++)
Re: How to create multiple page PDF from multiple images
Ah Yes !
I didn't seen that!
Best regards,
Loïc
I didn't seen that!
Best regards,
Loïc
Who is online
Users browsing this forum: No registered users and 0 guests