Converting Multi-page TIF to PDF
-
- Posts: 3
- Joined: Fri Nov 06, 2009 12:41 pm
Converting Multi-page TIF to PDF
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
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
Re: Converting Multi-page TIF to PDF
Hi Andrew,
Please, send us your project + image at esupprot (at) gdpicture (dot) com
Kind regards,
Loïc
Please, send us your project + image at esupprot (at) gdpicture (dot) com
Kind regards,
Loïc
-
- Posts: 3
- Joined: Fri Nov 06, 2009 12:41 pm
Re: Converting Multi-page TIF to PDF
Email with samples sent today at 10:30.
Thanks.
Thanks.
Re: Converting Multi-page TIF to PDF
Hi Andrew,
This problem will be fixed for the next release.
Kind regards,
Loïc
This problem will be fixed for the next release.
Kind regards,
Loïc
-
- Posts: 3
- Joined: Fri Nov 06, 2009 12:41 pm
Re: Converting Multi-page TIF to PDF
Thanks. But will you provide a timeframe for the next release?
Re: Converting Multi-page TIF to PDF
Hi,
The release should be available soon.
A beta can be downloaded from https://www.gdpicture.com/download/beta/
Kind regards,
Loïc
The release should be available soon.
A beta can be downloaded from https://www.gdpicture.com/download/beta/
Kind regards,
Loïc
Re: Converting Multi-page TIF to PDF
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:
Try this:
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)
Code: Select all
tempImageNumber = exportImage.CreateGdPictureImageFromFile("100031357.001")
exportImageId = exportImage.TiffCreateMultiPageFromGdPictureImage(tempImageNumber)
if tempImageNumber<>exportImageId then
exportImage.ReleaseGdPictureImage(tempImageNumber)
end if
Re: Converting Multi-page TIF to PDF
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.
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.
Who is online
Users browsing this forum: No registered users and 2 guests