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.

Mon Oct 20, 2014 8:27 pm

When attempting to convert from PDF to XPS with Spire.PDF (Free) and we are getting a GDI+ exception: "Bitmap region is already locked."

Stack trace:
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawImage(Image image, Single x, Single y, Single width, Single height)
at System.Drawing.Graphics.DrawImage(Image image, RectangleF rect)
at sprᜢ.ᜀ(Graphics A_0, spr᦮ A_1, spr᪨ A_2)
at spr᪨.ᜄ(String[] A_0)
at spr᪨.ᜀ(sprᯩ A_0)
at spr᪨.ᜄ(Boolean A_0)
at Spire.Pdf.PdfDocumentBase.ᜁ(Stream A_0, Int32 A_1)
at sprᴰ.ᜁ(PdfDocumentBase A_0, Stream A_1)
at sprᴰ.ᜃ(PdfDocumentBase A_0, Stream A_1)
at Spire.Pdf.PdfDocumentBase.SaveToXPS(String savefilename)
at Spire.Pdf.PdfDocumentBase.Save(String fileName, FileFormat fileformat)
at Spire.Pdf.PdfDocument.SaveToFile(String filename, FileFormat fileFormat)
at Kare.DocumentPrinter.print_Click(Object sender, EventArgs e)

This happens with every PDF file we try to convert.

The code is as follows:

string pdfFile = @"c:\temp\test.pdf";
string xpsPath = Path.ChangeExtension(pdfFile, ".xps");

Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
doc.LoadFromFile(pdfFile);
doc.SaveToFile(xpsPath, Spire.Pdf.FileFormat.XPS);
doc.Close();

I attempted to attach a PDF to test with (as it could perhaps be something with the PDF we're generating that's causing the issue), but apparently .PDF files cannot be uploaded as attachments.

I've attempted running the code compiled as "Any CPU", x64, and x86 all with the same result.

This is on a Win 7 x64 machine.

Any assistance would be appreciated!

Thanks,
-Will

karepharmacy
 
Posts: 3
Joined: Mon Oct 20, 2014 4:30 pm

Tue Oct 21, 2014 7:10 am

Hi,

Sorry for the inconvenience caused by us.
We have tested the issue in the environment same as yours and don't reproduce it.
Please provide your pdf document to us for testing.
Kindly note that please zip file before uploading it to our forum or send it to our Email(Support@e-iceblue.com).


Best Regards,
Lisa
E-iceblue support team
User avatar

lisa.chen
 
Posts: 21
Joined: Thu Mar 20, 2014 2:31 am

Tue Oct 21, 2014 2:29 pm

Please see attached pdf in zip file.

karepharmacy
 
Posts: 3
Joined: Mon Oct 20, 2014 4:30 pm

Wed Oct 22, 2014 2:09 am

Hi,

Thanks for your providing.
We have reproduced the issue you have, which has been transferred to our Dev team, once there are any progress, we will let you know. Sorry for inconvenience.
If there are any questions, welcome to get it back to us.

Best Regards
Lisa
E-iceblue support team
User avatar

lisa.chen
 
Posts: 21
Joined: Thu Mar 20, 2014 2:31 am

Fri Oct 31, 2014 3:05 pm

Do you have an update yet on the resolution of this issue?

karepharmacy
 
Posts: 3
Joined: Mon Oct 20, 2014 4:30 pm

Mon Nov 03, 2014 1:55 am

Hi,

Thanks for the long waitting.
Now there is a new version for Spire.PDF commercial edition which fixed the issue.
We recommend you to use our commercial edition of Spire.PDF which we give high priority of bug solutions and frequently version updates. We only maintain our free version of Spire.PDF when we have enough time and sorry that there is no exact time when it will be released.

This is the downloading link:http://www.e-iceblue.com/downloads/hot_fix/spire.pdf_hotfix_3.1.88.zip

Best Regards
Lisa
E-iceblue support team
User avatar

lisa.chen
 
Posts: 21
Joined: Thu Mar 20, 2014 2:31 am

Return to Spire.PDF