I have a solution that loads TIFFs from ByteArrays from a DB.
I load the byte array into a image processor:
primaryDocument = objImaging.CreateGdPictureImageFromByteArray(objImageBytes
And then use the GD viewer to display:
All this works as expected. However, when I try to rotate a single page TIFF file the behavior is a little odd. My rotate code is pretty simple, select the page, then call the Rotate method
Dim rotateStatus As GdPictureStatus = objImaging.TiffSelectPage(primaryDocument, gdViewer.CurrentPage)
If rotateStatus = GdPictureStatus.OK Then
rotateStatus = objImaging.Rotate(primaryDocument, RotateFlipType.Rotate90FlipNone)
The problem is that the TiffSelectPage returns an unsupported format.
If I put a debug statement in like so:
primaryDocument = objImaging.CreateGdPictureImageFromByteArray(objImageBytes)
Dim totalPages As Integer = objImaging.TiffGetPageCount(primaryDocument)
Dim currentPage As Integer = objImaging.TiffGetCurrentPage(primaryDocument)
I see an 18 page tiff has a page count of 18 and a current page of 1 as you would expect. A 1 page tiff has a page count of 0 and a currentPage of 0.
Does GD Picture handle one page TIFF differently ? Just wondering if I need to code for this ? I would expect a one page tiff to have a page count of 1 and a current page of 1.
Thank you for contacting us.
Please first of all try doing this in our latest version as this may already be fixed in V14.1.156:
If your issue persists, I would need to be able to replicate this on my end.
Could you provide me with a code project and the input file so I can run this "as is" and replicate your issue please?
If these are private you can contact us here:
Dim testDoc As Integer = objImaging.CreateGdPictureImageFromFile("C:\Test\onepage.tif")
Dim testDocPageCount As Integer = objImaging.TiffGetPageCount(testDoc) 'Result is 0
Dim testDocCurrPage As Integer = objImaging.TiffGetCurrentPage(testDoc) 'Result is 0
Dim blnMulti As Boolean = objImaging.TiffIsMultiPage(testDoc) 'Result is false
I've had to add a multi check before rotating.
My apologies for the delay.
Have you perhaps contacted us in the link above? Have we solved your issue since or does it persist?
You mention sharing the code isn't an option. Would you be able to provide the input document at least in this case?
Who is online
Users browsing this forum: No registered users and 1 guest