Page 1 of 1

Exeption in insert page.

Posted: Mon Jul 09, 2018 11:23 am
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.

Re: Exeption in insert page.

Posted: Mon Jul 09, 2018 11:37 am
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

Re: Exeption in insert page.

Posted: Mon Jul 09, 2018 2:12 pm
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.

Re: Exeption in insert page.

Posted: Thu Jul 12, 2018 2:53 pm
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

Re: Exeption in insert page.

Posted: Thu Jul 12, 2018 6:43 pm
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