[PdfCreateFromMultipageTIFF ] Documentation Clarification?

Discussions about PDF management.
Post Reply
MIKES
Posts: 49
Joined: Thu Jul 31, 2008 8:03 pm
Location: Michigan

[PdfCreateFromMultipageTIFF ] Documentation Clarification?

Post by MIKES » Fri Feb 06, 2009 5:02 pm

Normally when I open a TIFF I have no idea, before hand if it is a single page or multipage tiff.
So I am looking for a process that will handle either.
I realize the documention is referring specifically to handling a MultiPageTIFF.

The Documention Example for PdfCreateFromMultipageTIFF show this

Code: Select all

Dim MultipageImageID As Integer
oGdPictureImaging.TiffOpenMultiPageAsReadOnly(True) 'for better performances
MultipageImageID = oGdPictureImaging.CreateGdPictureImageFromFile("multipage.tif")
oGdPictureImaging.PdfCreateFromMultipageTIFF(MultipageImageID, "multipage.pdf", True, "MyPdfTitle", "MyPdfAuthor", "MyPdfSubject", "MyPdfKeywords", "MyPdfCreator")
oGdPictureImaging.ReleaseGdPictureImage(MultipageImageID)
Which looks to work fine for tiff with multiple pages.
But the CreateGdPictureImageFromFile when used on a TIFF with a single page does not
work with PdfCreateFromMultipageTIFF, that method returns an Invalid File Format.
(It took me a bit to realize why I was getting the Invalid File Format)

Are the two solutions for this?
1) use TiffCreateMultipageFromFile instead of CreateGdPictureImageFromFile
2) use the TiffCreateMultiPageFromGdPicture AFTER the CreateGdPictureImageFromFile

Is one better than the other?

Thanks

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Documentation Clarification?

Post by Loïc » Fri Feb 06, 2009 6:01 pm

Hi Mikes,

For your problem, the better method using GdPicture.NET is this one:

Code: Select all

Dim ImageID As Integer
Dim oGdPictureImaging As New GdPictureImaging

oGdPictureImaging.SetLicenseNumber("XXX")
oGdPictureImaging.TiffOpenMultiPageAsReadOnly(True) 'for better performances
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("multipage.tif")
If oGdPictureImaging.TiffIsMultiPage(ImageID) Then
   oGdPictureImaging.PdfCreateFromMultipageTIFF(ImageID, "multipage.pdf", True, "MyPdfTitle", "MyPdfAuthor", "MyPdfSubject", "MyPdfKeywords", "MyPdfCreator")
Else
   oGdPictureImaging.SaveAsPDF(ImageID, "singlepage.pdf", True, "MyPdfTitle", "MyPdfAuthor", "MyPdfSubject", "MyPdfKeywords", "MyPdfCreator")
End If
oGdPictureImaging.ReleaseGdPictureImage(ImageID)

Hope this helps.

Loïc

acoppi
Posts: 5
Joined: Tue Jun 02, 2009 10:36 pm

Re: [PdfCreateFromMultipageTIFF ] Documentation Clarification?

Post by acoppi » Sat Jun 06, 2009 4:38 pm

dear Loic ,
how can I use it with asp language ??

thanks in advance

Angelo

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest