Page 1 of 1

Wrong chars on double pdf files

Posted: Thu Jul 19, 2018 6:28 pm
by dkaip
Hello.
If i try to add 2 times the same pdf file, the result is wrong.
I just send the 1.pdf file and the result in 2.pdf in zip 12.zip file.
Thank you
Jim.

Re: Wrong chars on double pdf files

Posted: Thu Jul 19, 2018 9:07 pm
by utelle
dkaip wrote:If i try to add 2 times a pdf file, the result is wrong.
I just send the 1.pdf file and the result in 2.pdf in zip 12.zip file.
You could call this a bug in wxPdfDocument. wxPdfDocument keeps a list of PDF parsers for each PDF document, for which method SetSourceFile is invoked. However, it was not checked whether a parser for a document with the given filename is already in the list. This results in corrupting the resource object list of the previous parser, if the same filename is presented to method SetSourceFile more than once..

I adjusted method SetSourceFile to detect whether a parser already exists. The adjusted version worked for me.

Please download the latest wxPdfDocument from https://github.com/utelle/wxpdfdoc.

Regards,

Ulrich

Re: Wrong chars on double pdf files

Posted: Fri Jul 20, 2018 11:12 am
by dkaip
Hello. It works very fine now.
Thank you.
Jim