Exeption in insert page.

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 333
Joined: Wed Jan 20, 2010 1:15 pm

Exeption in insert page.

Post by dkaip »

Hello.
I have a pdf page to import of a pdf.
But in page i there is not any pdf object, there are only white pages.
How i can prevent craches in those pages?

Code: Select all

int tpl = exportPdfFile.ImportPage(i);
Thank you
Jim.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Exeption in insert page.

Post by utelle »

dkaip wrote:I have a pdf page to import of a pdf.
But in page i there is not any pdf object, there are only white pages.
How i can prevent craches in those pages?

Code: Select all

int tpl = exportPdfFile.ImportPage(i);
Please provide a sample PDF file for which the import crashes. I would have to further analyze why a crash happens.

Regards,

Ulrich
dkaip
Super wx Problem Solver
Super wx Problem Solver
Posts: 333
Joined: Wed Jan 20, 2010 1:15 pm

Re: Exeption in insert page.

Post by dkaip »

Hello.File is big to upload. I send link from where download it...
At page 39 crashes ..
Also i see a strange think. Adding some different pdf files to one, some times fonts of a pdf affects to fonts of final pdf file. There is a way while inserting a pdf file to not affects to final?

Thank you.
Jim.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Exeption in insert page.

Post by utelle »

dkaip wrote:Hello.File is big to upload. I send link from where download it...
At page 39 crashes ..
The reason is that the pages 39 and 40 are completely empty, no associated content, no associated resources. It seems that these empty pages were added later in a separate update of the document, because the prior version of the document contained in fact only 38 pages.

Never before I have come across such a PDF, and I have to admit that wxPdfDocument fails to handle such completely empty pages. And to be frank, I don't know yet how wxPdfDocument should handle such a case. Yes, it should not crash, but what should be imported if there is absolutely no page content to import? I have to think about how to fix this issue.
dkaip wrote:Also i see a strange think. Adding some different pdf files to one, some times fonts of a pdf affects to fonts of final pdf file.
Could you please describe precisely what kind of effect you observe?
dkaip wrote:There is a way while inserting a pdf file to not affects to final?
First, I have to understand what exactly happens. Could you provide a sample set of PDF files?

Regards,

Ulrich
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Exeption in insert page.

Post by utelle »

I applied a fix for the issue on importing a completely empty page.

Please download the latest wxPdfDocument from https://github.com/utelle/wxpdfdoc. With this adjusted version your application should no longer crash on importing page 39 (or 40) of your PDF document.

Regards,

Ulrich
Post Reply