Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - C# QuickPDFDARenderPageToFile throws SEHException
  FAQ FAQ  Forum Search   Register Register  Login Login

C# QuickPDFDARenderPageToFile throws SEHException

 Post Reply Post Reply
Author
Message
murpium View Drop Down
Beginner
Beginner
Avatar

Joined: 14 Jun 12
Location: Texas
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote murpium Quote  Post ReplyReply Direct Link To This Post Topic: C# QuickPDFDARenderPageToFile throws SEHException
    Posted: 14 Jun 12 at 9:49PM
A set of PDFs a customer sent us has broken my program for batch converting PDFs to G4 TIFF files at 300 DPI.

The chunk of code affected seems to be:

PDFLibrary pdflib = new PDFLibrary("QuickPDFDLL0816.dll");
pdflib.UnlockKey("my key here");
handle = pdflib.DAOpenFileReadOnly(file, "");
int numpages = pdflib.DAGetPageCount(handle);
for (int j = 1; j <= numpages; j++) {
    int pHandle = pdflib.DAFindPage(handle, j);
    int ret = pdflib.DARenderPageToFile(handle, pHandle, 10, dpi, outputFile.ToString() + " page " + j + ".tif");
}
pdflib.DACloseFile(handle);

When DPI is changed from 300 to 150 it doesn't throw the exception, but rather creates a completely white/empty PDF. I'm running Windows 7 64-bit with 16GB of RAM (although the program is 32-bit and appears to cap out at 1GB of RAM). Is 300 DPI just too much for this document? Is there a way to get a more descriptive reason as to why this error is thrown?


One of the PDF files in the set is available here to look at:
http://dl.dropbox.com/u/11659372/Volume%201%20Combined%202.pdf

From what I can tell the PDFs from the client were created in Adobe Acrobat 9.2 (there's a line about it if I open the PDF in Notepad++ but you may want to check for yourself).

Thanks. Please let me know if I left out any additional information that might be helpful.


Edited by murpium - 14 Jun 12 at 10:14PM
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jun 12 at 12:38PM
That is a very large PDF to be rendering at 300dpi in 32bit mode.  

The page size is 91.4cm x 1.2 metres  -  ie  about 1m square.   10795 x 14505 pixels which requires lots of memory to  process and render.

I would suggest you compile your app in 64bit mode if possible.  I am pretty sure Quick PDF library is having memory issues rendering this PDF.

Andrew.
Back to Top
murpium View Drop Down
Beginner
Beginner
Avatar

Joined: 14 Jun 12
Location: Texas
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote murpium Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jun 12 at 3:59PM
Thank you, AndrewC. I switched to compiling in 64-bit and using the 64-bit QuickPDF DLL and that has resolved my problem. The program now jumps up to about 2GB of memory when creating a TIFF and lowers back down to 500MB between conversions. I understand that the output TIFF is gargantuan but I was hoping use of the DA (Direct Access) functions would have helped keep the memory usage lower.
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jun 12 at 10:15AM
We will be looking at optimisation of this type of task for the upcoming QPL 9.xx releases.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store