[reportlab-users] FW: Adobe Reader - Outline Font.

Ian Sparks Ian.Sparks at etrials.com
Tue Apr 3 15:50:57 EDT 2007



Robin Becker wrote:

>>

We recently had to go through this ourselves. With latest reportlab we can
use unicode encoding in that part of the pdf output and then PDF will respect the glyphs if the appropriate fonts are available to the reader. The fonts used are not a property of the document (I think), but of the viewing application. That's true for bookmarks at least. I believe the same is true for some of the annotations eg author etc etc.

The problem is that I cannot figure out exactly how this gets done in platypus/canvas land as the examples are all in rml eg

outlineAdd level="1">Ampersand (&amp;) and Japanese (またはご希望のホテルを1つ選択してください) Test</outlineAdd> <para>Check that the ampersand (&amp;) appears correctly in the outline/bookmark list.</para>

the above text in the example is good utf8 and when I view it I see japanese characters in the bookmarks.

I think it works like this:

1) the outline texts eventually end up using PDFString instances.
2) The PDFString instance checks to see if the text can be rendered using PDFDoc encoding. If yes that is used otherwise utf_16_be is output and then it's the viewer's responsibility to make the right glyph substitutions.
--
<<

Robin,

Thanks for the reply. Seems tantalizingly close but I can't get it to work for me. I'm using Reportlab in the raw, not platypus but even ensuring that all my outline entries are UTF-8 encoded I still get garbage in Adobe Reader 7.

I attach a test program. Any advice?




> -----Original Message-----

> From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-

> bounces at reportlab.com] On Behalf Of Robin Becker

> Sent: Tuesday, April 03, 2007 2:05 PM

> To: Support list for users of Reportlab software

> Subject: Re: [reportlab-users] Adobe Reader - Outline Font.

>

> Ian Sparks wrote:

> > Hello,

> >

> >

> >

> > If I use addOutlineEntry() is there any way to se the font that Adobe

> > Reader will use to display the outline?

> >

> >

> >

> > I'm setting outline text using some Chinese (trad) characters and it

> > looks like it's using only the Latin encoding in Adobe Reader.

> >

> >

> >

> > I'm experimenting with the Code2000 font. Can I set the reader to use

> > that font for the outline if I embed it?

> >

> >

> >

> > FYI : This is Reportlab 2.0

> >

> ........

>

> We recently had to go through this ourselves. With latest reportlab we

> can use

> unicode encoding in that part of the pdf output and then PDF will respect

> the

> glyphs if the appropriate fonts are available to the reader. The fonts

> used are

> not a property of the document (I think), but of the viewing application.

> That's

> true for bookmarks at least. I believe the same is true for some of the

> annotations eg author etc etc.

>

> The problem is that I cannot figure out exactly how this gets done in

> platypus/canvas land as the examples are all in rml eg

>

> outlineAdd level="1">Ampersand (&amp;) and Japanese

> (またはご希望のホテルを1つ選択してください)

> Test</outlineAdd>

> <para>Check that the ampersand (&amp;) appears correctly in the

> outline/bookmark

> list.</para>

>

> the above text in the example is good utf8 and when I view it I see

> japanese

> characters in the bookmarks.

>

> I think it works like this:

>

> 1) the outline texts eventually end up using PDFString instances.

> 2) The PDFString instance checks to see if the text can be rendered using

> PDFDoc

> encoding. If yes that is used otherwise utf_16_be is output and then it's

> the

> viewer's responsibility to make the right glyph substitutions.

> --

> Robin Becker




-----------------------------------------
Disclaimer:

This e-mail communication and any attachments may contain
confidential and privileged information and is for use by the
designated addressee(s) named above only. If you are not the
intended addressee, you are hereby notified that you have received
this communication in error and that any use or reproduction of
this email or its contents is strictly prohibited and may be
unlawful. If you have received this communication in error, please
notify us immediately by replying to this message and deleting it
from your computer.

Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outlinetest.zip
Type: application/x-zip-compressed
Size: 639 bytes
Desc: outlinetest.zip
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20070403/6d74b7a6/attachment.bin>


More information about the reportlab-users mailing list