Converting Multi-page TIF to PDF

Discussions about PDF management.
Post Reply
AndrewAckr
Posts: 3
Joined: Fri Nov 06, 2009 12:41 pm

Converting Multi-page TIF to PDF

Post by AndrewAckr » Fri Nov 06, 2009 2:06 pm

When converting a multi-page TIF to PDF GDPicture 'hangs' and eventually raises the low level .Net Runtime memory error shown below:

NET Runtime version 2.0.50727.3603 - Fatal Execution Engine Error (6E8F795E) (80131506)

I have a sample VS2008 solution to demonstrate the problem, but it is larger than the 2MB attachment limit. Do you have an email address I can send the attachment to?

This problem only occurs with some images, but the attachment limit prevents me from including sample images. The process I am using is outlined below:

Dim myGDPicture As Reflection.Assembly = Nothing
myGDPicture = Reflection.Assembly.LoadFrom(GDPictureLocation)
Dim exportImage As Object = Nothing
exportImage = myGDPicture.CreateInstance("GdPicture.GdPictureImaging", True)
exportImage.SetLicenseNumber(LICENSE_NUMBER)

add the first page as follows:
tempImageNumber = exportImage.CreateGdPictureImageFromFile("100031357.001")
exportImageId = exportImage.TiffCreateMultiPageFromGdPictureImage(tempImageNumber)
exportImage.ReleaseGdPictureImage(tempImageNumber)

add the other two pages:
exportImage.TiffAppendPageFromFile(exportImageId, "SourceImage1\100031357.002")
exportImage.TiffAppendPageFromFile(exportImageId, "SourceImage1\100031357.003")

then convert the image to a pdf:
exportImage.PdfCreateFromMultipageTIFF(exportImageId, tempFilePath, True, "", "", "", "", "")

It is the above line which causes the crash.

This is very urgent as it is causing serious problems at a customer site.

Thank you.

Andrew Ackroyd
Analyst Programmer

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

Re: Converting Multi-page TIF to PDF

Post by Loïc » Fri Nov 06, 2009 2:54 pm

Hi Andrew,

Please, send us your project + image at esupprot (at) gdpicture (dot) com

Kind regards,

Loïc

AndrewAckr
Posts: 3
Joined: Fri Nov 06, 2009 12:41 pm

Re: Converting Multi-page TIF to PDF

Post by AndrewAckr » Mon Nov 09, 2009 12:26 pm

Email with samples sent today at 10:30.

Thanks.

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

Re: Converting Multi-page TIF to PDF

Post by Loïc » Mon Nov 09, 2009 1:37 pm

Hi Andrew,

This problem will be fixed for the next release.

Kind regards,

Loïc

AndrewAckr
Posts: 3
Joined: Fri Nov 06, 2009 12:41 pm

Re: Converting Multi-page TIF to PDF

Post by AndrewAckr » Fri Nov 13, 2009 6:58 pm

Thanks. But will you provide a timeframe for the next release?

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

Re: Converting Multi-page TIF to PDF

Post by Loïc » Fri Nov 13, 2009 7:01 pm

Hi,

The release should be available soon.

A beta can be downloaded from https://www.gdpicture.com/download/beta/

Kind regards,

Loïc

User avatar
dreynolds
Posts: 43
Joined: Thu Oct 29, 2009 4:07 pm
Location: King of Prussia, PA, USA
Contact:

Re: Converting Multi-page TIF to PDF

Post by dreynolds » Wed Nov 25, 2009 6:32 pm

I'm not sure if this will help, but you may want to check your ImageIDs before releasing them.

I was under the impression that whenever you use the Create methods to return an ImageID that it would always return a new ID. That is not always true. Sometimes GdPicture.NET will return the same ID for the new image created as it returned for the source image. So if you release the source, thinking the ID is not in use, you actually release the source and created image. I always check if NewID<>SourceID before releasing the SourceID.

This changes how you must handle IDs. If a large amount of processing is occurring and many outputs are created from a single source, you may even need to keep an array of any ImageIDs used, release them conditionally if they aren't in use and set them to 0 explicitly, then at the end of everything release any IDs that were not set to 0.

Instead of this:

Code: Select all

tempImageNumber = exportImage.CreateGdPictureImageFromFile("100031357.001")
exportImageId = exportImage.TiffCreateMultiPageFromGdPictureImage(tempImageNumber)
exportImage.ReleaseGdPictureImage(tempImageNumber)
Try this:

Code: Select all

tempImageNumber = exportImage.CreateGdPictureImageFromFile("100031357.001")
exportImageId = exportImage.TiffCreateMultiPageFromGdPictureImage(tempImageNumber)
if tempImageNumber<>exportImageId  then
      exportImage.ReleaseGdPictureImage(tempImageNumber)
 end if

User avatar
dreynolds
Posts: 43
Joined: Thu Oct 29, 2009 4:07 pm
Location: King of Prussia, PA, USA
Contact:

Re: Converting Multi-page TIF to PDF

Post by dreynolds » Tue Dec 01, 2009 7:30 am

GdPicture.NET version 6.5.0 was released 11/30/2009.

Also if you discovered the issue of reused ImageIDs that I pointed out and are still having trouble, look at the CreateClonedGdPictureImageI() method. I sometimes use that method to ensure a new ImageID from the original input file and save all of the clones for release after processing.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests