You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Andrew Munn <an...@nmedia.net> on 2015/04/22 04:49:19 UTC

Windows font error

I am adding some text to a PDF and when I open it in acrobat viewer I get 
two errors:

"An error exists on this page.  Acrobat may not display the page 
correctly.  Please contact the person who created teh PDF document to 
correct the problem"

and a couple secs later:

"Cannot find or create the font 'AAAAVG+ArielMT'.  Some character may not 
display or print correctly."

And the characters are replaced with little round dots.

I am running the latest 2.0.0 snapshot.  Code is:

 File f1 = new File("C:\\windows\\fonts\\arial.ttf");
 font = PDType0Font.load(document, f1);
 PDPageContentStream cos = new PDPageContentStream(document, p, true, true);
 cos.showText("my text");

Other fonts either do the same thing (lsans.ttf,times.ttf) or give the 
error about the missing glyph.  If I render that page as a PNG and save it 
the font appears correctly.

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Windows font error

Posted by John Hewson <jo...@jahewson.com>.
Hi,

> On 21 Apr 2015, at 19:49, Andrew Munn <an...@nmedia.net> wrote:
> 
> I am adding some text to a PDF and when I open it in acrobat viewer I get 
> two errors:
> 
> "An error exists on this page.  Acrobat may not display the page 
> correctly.  Please contact the person who created teh PDF document to 
> correct the problem"
> 
> and a couple secs later:
> 
> "Cannot find or create the font 'AAAAVG+ArielMT'.  Some character may not 
> display or print correctly."
> 
> And the characters are replaced with little round dots.
> 
> I am running the latest 2.0.0 snapshot.  Code is:
> 
> File f1 = new File("C:\\windows\\fonts\\arial.ttf");
> font = PDType0Font.load(document, f1);
> PDPageContentStream cos = new PDPageContentStream(document, p, true, true);
> cos.showText("my text");

Can you include the complete, working code which you're using, e.g. where did "p" come from? It looks like you're trying to append content to an existing page, is that correct?

-- John

> Other fonts either do the same thing (lsans.ttf,times.ttf) or give the 
> error about the missing glyph.  If I render that page as a PNG and save it 
> the font appears correctly.
> 
> Thanks
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Windows font error

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 22.04.2015 um 04:49 schrieb Andrew Munn:
> I am adding some text to a PDF and when I open it in acrobat viewer I get
> two errors:
>
> "An error exists on this page.  Acrobat may not display the page
> correctly.  Please contact the person who created teh PDF document to
> correct the problem"
>
> and a couple secs later:
>
> "Cannot find or create the font 'AAAAVG+ArielMT'.  Some character may not
> display or print correctly."
>
> And the characters are replaced with little round dots.
>
> I am running the latest 2.0.0 snapshot.  Code is:
>
>   File f1 = new File("C:\\windows\\fonts\\arial.ttf");
>   font = PDType0Font.load(document, f1);
>   PDPageContentStream cos = new PDPageContentStream(document, p, true, true);
>   cos.showText("my text");
>
> Other fonts either do the same thing (lsans.ttf,times.ttf) or give the
> error about the missing glyph.  If I render that page as a PNG and save it
> the font appears correctly.

What windows version do you have? What else do you do with the content 
stream? I'd need the smallest possible code for that to try it myself. 
It sounds like a bug with font subsetting.

Having the result PDF file would also be useful.

Tilman

>
> Thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org