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 Feb 20, 2018 2:16 pm

Spire.PDF version 4.2.0.2035 when using

Code: Select all
string dest = pdf.Replace(".pdf", ".xps");
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(pdf);
doc.SaveToFile(dest, FileFormat.XPS);


Runs out of memory with large PDF files, I generate a PDF that is a collection of PDF's, the PDF that i tested with has 1580 pages, the maximum size of the pdf will be around 1,600 pages for the small batches and for the large batches could have up to 2100 pages per PDF, i need to speed up the print job, but in order to do that, i need to convert the document to XPS format and add it to the printers print queue, and unfortunately the doc.Print() method doesn't just add it to the queue, it does a similar action to just print. This is causing delays in the printing process on large documents. I also need a progress meter during the "savetofile" method, something async, so that i can let the user know something is happening, other than a simple delay when you can't tell anything is happening.

Edit: just updated my program to have a max of 400 pages and the XPS process runs out of memory still, going to keep reducing the max pages to see how low it needs to be for the XPS save to work.

Edit: after a lot of adjustments, the highest number of pages allowed by Spire.PDF for save to XSP is around 160, give or take, depending on if you have images or not, that is 160 pages with just 1 small barcode image, but if you have a lot of images, you have to reduce the number of pages or it won't save to an XPS, plus it alters the image, it stretches/skews and moves the image when you save from a PDF format to an XPS format.

JonathanWood
 
Posts: 26
Joined: Fri Feb 26, 2016 2:19 am

Wed Feb 21, 2018 3:42 am

Hello,

Sorry for the inconvenience caused by the issue.
Please share your system details, for example, win7 x64, RAM:8G.
And in order to speed up our investigation processes, it would be great if you please provide us with your sample pdf file. You could send file to support@e-iceblue.com.
Looking forward to your further providing.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Mon Feb 26, 2018 7:50 am

Hello Jonathan,

Could you please provide us the information above for investigations?
Thank you in advance.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Tue Jul 23, 2019 2:10 pm

Sorry I didn't get notice of this request in my email, Intex Xeon 2.19 GHz dual processor, 8 GB ram, 64 Bit OS Windows Server 2012 R2 Standard

JonathanWood
 
Posts: 26
Joined: Fri Feb 26, 2016 2:19 am

Wed Jul 24, 2019 8:38 am

Hello,

Thanks for your feedback.
I simulated a PDF with 200 pages. Its size is about 12MB and some pages include images. When testing the simulated PDF file with Spire.PDF Pack Version:5.7 and same testing environment as yours. I didn't encounter your issue. Based on your another post, I have learned that your PDF file contains client sensitive information and can't provide for our reference. As for your situation, I prefer to suggest you try again with the latest version, if the issue still occurs, please tell us the size of your PDF file, so that we can simulate a similar size file to further look into it.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF