Exeption in insert page.

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
dkaip
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Wed Jan 20, 2010 1:15 pm

Exeption in insert page.

Postby dkaip » Mon Jul 09, 2018 11:23 am

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: 823
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Exeption in insert page.

Postby utelle » Mon Jul 09, 2018 11:37 am

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
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Wed Jan 20, 2010 1:15 pm

Re: Exeption in insert page.

Postby dkaip » Mon Jul 09, 2018 2:12 pm

Hello.File is big to upload. I send link from where download it...
At page 39 crashes ..
https://www.epamhellas.gr/site_files/minisi-epi-esxati-epam-hellas.pdf


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: 823
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Exeption in insert page.

Postby utelle » Thu Jul 12, 2018 2:53 pm

dkaip wrote:Hello.File is big to upload. I send link from where download it...
At page 39 crashes ..
https://www.epamhellas.gr/site_files/minisi-epi-esxati-epam-hellas.pdf


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: 823
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: Exeption in insert page.

Postby utelle » Thu Jul 12, 2018 6:43 pm

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


Return to “wxCode”

Who is online

Users browsing this forum: No registered users and 6 guests