Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Sep 12, 2017 5:48 pm

Hey there,

I need a big hand here, cannot solve and have spent significant time troubleshooting without success.

I am using Spire.PDF to convert a PDF to an image BLOB, so that I may store it in a database. In testing, I've generalized this down to simply saving as an image and removed the whole BLOB from the equation.

I've attached two documents:
1) TestDocument.pdf - the original PDF document which I convert to an image BLOB.
2) TestDocument.jpeg - the saved image of the loaded PDF.

The code is very obvious and straight-forward - I load the PDF document, save it to a second file (to confirm the PDF save works correctly), write it to an image object, save the image to the desktop and then as a byte array (which I would later use to insert into a database).

The problem is that the text at the bottom is being flipped - you can see the original text within the TestDocument PDF, and then looking at the image something very weird has happened...

Code: Select all

byte[] streamText = null;
PdfDocument pdfDoc = new PdfDocument();
Image img = null;
MemoryStream imageStream = null;

pdfDoc.LoadFromFile("C:\\Users\\curtis.watson\\Desktop\\TestDocument.pdf");                   
pdfDoc.SaveToFile("C:\\Users\\curtis.watson\\Desktop\\TestDocument2.pdf");
img = pdfDoc.SaveAsImage(0, Spire.Pdf.Graphics.PdfImageType.Bitmap, 96, 96);

imageStream = new MemoryStream();
img.Save(imageStream, System.Drawing.Imaging.ImageFormat.Jpeg);
img.Save("C:\\Users\\curtis.watson\\Desktop\\TestDocument.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
                   
streamText = imageStream.ToArray();

curtiswatson
 
Posts: 2
Joined: Wed Aug 09, 2017 6:54 pm

Wed Sep 13, 2017 1:58 am

Dear curtiswatson,

Thanks for your inquiry.
I have reproduced your issue and posted it to our Dev team. We will inform you when it is fixed.
Sorry for the inconvenience.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Sep 13, 2017 2:22 pm

Thanks for the quick reply / investigation Betsy. Is there any estimation on when a hotfix / release for this issue may be distributed? Will this be fixed in the community edition of Spire.PDF or only the commercial? Thanks again!

Betsy.jiang wrote:Dear curtiswatson,

Thanks for your inquiry.
I have reproduced your issue and posted it to our Dev team. We will inform you when it is fixed.
Sorry for the inconvenience.

Sincerely,
Betsy
E-iceblue support team

curtiswatson
 
Posts: 2
Joined: Wed Aug 09, 2017 6:54 pm

Thu Sep 14, 2017 1:59 am

Dear curtiswatson,

Thanks for your response.
Sorry that we cannot give you any estimated time at present, and we will let you know once there is any progress. And the hotfix will be only included into commercial version. We don't have the plan to update free version now.
If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Oct 20, 2017 7:11 am

Dear curtiswatson,

Thanks for waiting.
Now we publish the Spire.PDF Pack(Hot Fix) Version:3.9.407 which solves your issue.
If there is any question, please let us know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Oct 24, 2017 8:07 am

Dear curtiswatson,

Greetings from E-iceblue.
Has your issue been resolved ? Could you please give us some feedback.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF