Well spotted Thomas, that fixed the issue! 

Thanks a bunch,
Blayne

-----Original Message-----
From: Thomas Barnekov <thomas.barne...@formpipe.com> 
Sent: 14 June 2022 10:43
To: podofo-us...@lists.sf.net
Subject: Re: [Podofo-users] An error exists on this page...

Both PDFs (embedded and not embedded) fails on my Acrobat Reader.

I noticed when examining the files that your text objects (the stuff between BT 
and ET in the content stream) contains q/Q operators. Those belong to the 
category "Special graphics state" operators which are not allowed in text 
objects according to figure 4.1 in the PDF 1.4 reference.

Try moving those operators outside the text objects instead.

/TB

-----Original Message-----
From: Blayne Cullen <blay...@pulsonix.com>
Sent: 13. juni 2022 17:10
To: Francesco Pretto <cez...@gmail.com>; podofo-us...@lists.sf.net
Subject: Re: [Podofo-users] An error exists on this page...

Thank you for your response.

I've tested your solution using PdfDoc->CreateFontSubset(...) which I hope uses 
your mentioned PdfFontCache::GetFontSubset() but am still receiving the same 
error. I also found that using this solution and embedding the font 
(PdfFont->EmbedSubsetFont()) causes the characters to become unrecognisable "?" 
whilst not embedding it prints them correctly. I have also tested this using 
Arial and getting the same aforementioned issues. Would these issues be related 
to the bugs you mentioned or is this something else?

Attached are examples of the newly generated PDF's. One has embedded the font 
and the other has not.
Thanks,
Blayne

-----Original Message-----
From: Francesco Pretto <cez...@gmail.com>
Sent: 13 June 2022 12:07
To: Blayne Cullen <blay...@pulsonix.com>
Cc: podofo-us...@lists.sf.net
Subject: Re: [Podofo-users] An error exists on this page...

Hello,

you're right something is wrong with the text. In particular something is wrong 
with the embedding of the font: my advice is that you should really use 
subsetting with PdfFontCache::GetFontSubset() when retrieving the font, 
otherwise it will embed the whole font and that may cope with the encoding you 
picked, possibly causing the issues you're seeing. Subsetting forces PoDoFo to 
create a different font type (/Type0), which is a more modern font type and 
works better with fonts with Unicode character set (like the one you're using).
Unfortunately there are some other bugs with subsetting TrueType fonts in 
PoDoFo 0.9.x series, but subsetting Arial usually works fine. I can't help more 
with PoDoFo but in a couple of months PoDoFo-next, which is the new code base 
for PoDoFo, will appear and that handles these scenarios better, it's easier to 
code and has a lot of bug fixing.

Regards,
Francesco


On Mon, 13 Jun 2022 at 12:33, Blayne Cullen <blay...@pulsonix.com> wrote:
>
> Hello PoDoFo Team,
>
>
>
> I have been using the product for a little over a year now and I have been 
> intermittently getting the Adobe Acrobat error: “An error exists on this 
> page. Acrobat may not display the page correctly. Please contact the person 
> who created the PDF document to correct the problem.” (Screenshot attached). 
> This error does not occur in all of our PDF productions, just a few. The 
> generated PDF appears to be correct and on opening of the file in other PDF 
> viewers, no error is mentioned (though this is probably because they don’t 
> have the same error checking features that acrobat have). Also attached is a 
> copy of a simple example PDF document that contains the error. Some debugging 
> points to the text or even the font as the culprit, but this could be a red 
> herring.
>
>
>
> I have recently upgraded PoDoFo and its dependencies in an effort to resolve 
> the problem, but no luck.
>
> We are currently using:
>
> Visual Studio 2022
> FreeType 2.12.1, Z-Lib 1.2.11, Jpeg 9d Targeting Windows 10 Using 
> PoDoFo 0.9.8 - 32 and 64bit shared libraries (dll)
>
>
>
> Look forward to your reply,
>
> Thanks,
>
> Blayne
>
> _______________________________________________
> Podofo-users mailing list
> Podofo-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/podofo-users

_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to