You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Mickael Marrache <mi...@gmail.com> on 2018/04/27 08:39:54 UTC

About the WinAnsiEncoding error

Hi,

I created a blank PDF with Acrobat Pro DC. I added one text field with font
David. I filled the text field using Acrobat so that it displays the David
font in the fonts section (in Document Properties window). Then, I applied
fixup "Embed missing fonts" via the Preflight menu.

When I look at the fonts list (in Document Properties), I can see the David
font with the following properties:

David (Embedded Subset)
Type: TrueType (CID)
Encoding: Identity-H

When I try to set a value containing Hebrew characters using PDF box, I get
the following error:

java.lang.IllegalArgumentException: U+05D0 is not available in this font's
encoding: WinAnsiEncoding
at
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(PDTrueTypeFont.java:399)
at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:352)

I already know the workaround of embedding a font before setting the value
but I'm trying to understand what is going on here. I understand the Hebrew
characters are not in the WinAnsiEncoding but why this encoding is used at
the first place?

Thanks,
Mickael

Re: About the WinAnsiEncoding error

Posted by Mickael Marrache <mi...@gmail.com>.
Thanks Maruan but if I understand correctly, the issue is generally related
to Acrobat DC mentioning ANSI for the encoding which of course doesn't
allow hebrew characters but here it shows Identity-H. Does this encoding
support hebrew characters?

Le ven. 27 avr. 2018 à 18:36, Maruan Sahyoun <sa...@fileaffairs.de> a
écrit :

> Hi,
> > Am 27.04.2018 um 14:24 schrieb Mickael Marrache <
> mickaelmarrache@gmail.com>:
> >
> > Hi Maruan,
> >
> > You can download the PDF from here:
> >
> > https://drive.google.com/open?id=13QCyxxZvYjRQ4I5tP4-6c7bAPCtsCaHz
> >
> > The font is displayed as Embedded Subset - but in my case I have the
> David
> > font on my system.
>
> what happens is that if the form is filled using Adobe Reader then instead
> of only looking at the font information embedded in the PDF the embedded
> font program will also be used to find the "character". This will then be
> used as the new subset for the font in the field.
>
> Have a look at https://stackoverflow.com/a/43002076/4690214 for a
> possible workaround.
>
> BR
> Maruan
>
>
> >
> > Thanks,
> > Mickael
> >
> > On Fri, Apr 27, 2018 at 2:59 PM, Maruan Sahyoun <sa...@fileaffairs.de>
> > wrote:
> >
> >>
> >>> Am 27.04.2018 um 13:44 schrieb Mickael Marrache <
> >> mickaelmarrache@gmail.com>:
> >>>
> >>> This is what I meant by Document Properties, but it only shows you the
> >>> fonts used by the document and tells if embedded or subset embedded,
> but
> >>> nothing more.
> >>>
> >>> I really don't understand why a PDF can be filled with Acrobat DC or
> >> Reader
> >>> but not with PDFBOX.
> >>>
> >>> Assuming the font is installed on the system (in my case Windows) and
> is
> >>> not embedded, both Acrobat and PDFBOX should have access to the font on
> >>> this system.
> >>
> >> PDFBox doesn't look for additional fonts if the font is embedded. It
> >> simply tries to use the font which is part of the PDF. What happens if
> the
> >> PDF is distributed to someone who doesn't have the font installed? Could
> >> you share the PDF on a public location? As I don't have the font
> installed
> >> I would be interested to try filling it with Adobe Reader/Acrobat to see
> >> what might be used instead.
> >>
> >> BR
> >> Maruan
> >>
> >>>
> >>> What information is missing to PDFBOX to properly set the value?
> >>>
> >>> I'm aware of this issue since a year but can't find any information on
> >> it.
> >>>
> >>> On Fri, Apr 27, 2018 at 2:05 PM, Hartmann Toël <
> >> Toel.Hartmann@elanders.com>
> >>> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> I am not sure, but
> >>>>
> >>>> https://helpx.adobe.com/acrobat/using/pdf-fonts.html
> >>>>
> >>>> says
> >>>> File > Properties > Font tab
> >>>>
> >>>> Does this help?
> >>>>
> >>>>
> >>>>
> >>>> *  m3 developer*
> >>>> Elanders Sverige AB
> >>>> Phone Switchboard: +46 31 750 00 00
> >>>> Phone direct: +46 31 750 08 86
> >>>> E-mail: toel.hartmann@elanders.com
> >>>> Homepage: www.elanders.se
> >>>>
> >>>> On 27 apr 2018, at 10:56, Mickael Marrache <mickaelmarrache@gmail.com
> >
> >>>> wrote:
> >>>>
> >>>> Hi,
> >>>>
> >>>> Do you know a way to cause it to fully embed the font?
> >>>>
> >>>> Mickael
> >>>>
> >>>> On Fri, Apr 27, 2018 at 11:46 AM, Hartmann Toël <
> >>>> Toel.Hartmann@elanders.com>
> >>>> wrote:
> >>>>
> >>>> Hi,
> >>>>
> >>>> It seems Acrobat is only embedding the glyph used in your text as a
> >>>> subset, the complete font is not included.
> >>>>
> >>>> Could that be the problem?
> >>>>
> >>>> /Toël
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> *  m3 developer*
> >>>>
> >>>> Elanders Sverige AB
> >>>> Phone Switchboard: +46 31 750 00 00
> >>>> Phone direct: +46 31 750 08 86
> >>>> E-mail: toel.hartmann@elanders.com
> >>>> Homepage: www.elanders.se
> >>>>
> >>>> On 27 apr 2018, at 10:39, Mickael Marrache <mickaelmarrache@gmail.com
> >
> >>>> wrote:
> >>>>
> >>>> Hi,
> >>>>
> >>>> I created a blank PDF with Acrobat Pro DC. I added one text field with
> >> font
> >>>> David. I filled the text field using Acrobat so that it displays the
> >> David
> >>>> font in the fonts section (in Document Properties window). Then, I
> >> applied
> >>>> fixup "Embed missing fonts" via the Preflight menu.
> >>>>
> >>>> When I look at the fonts list (in Document Properties), I can see the
> >> David
> >>>> font with the following properties:
> >>>>
> >>>> David (Embedded Subset)
> >>>> Type: TrueType (CID)
> >>>> Encoding: Identity-H
> >>>>
> >>>> When I try to set a value containing Hebrew characters using PDF box,
> I
> >> get
> >>>> the following error:
> >>>>
> >>>> java.lang.IllegalArgumentException: U+05D0 is not available in this
> >> font's
> >>>> encoding: WinAnsiEncoding
> >>>> at
> >>>> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(
> >>>> PDTrueTypeFont.java:399)
> >>>> at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
> >>>> at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(
> >> PDFont.java:352)
> >>>>
> >>>> I already know the workaround of embedding a font before setting the
> >> value
> >>>> but I'm trying to understand what is going on here. I understand the
> >> Hebrew
> >>>> characters are not in the WinAnsiEncoding but why this encoding is
> used
> >> at
> >>>> the first place?
> >>>>
> >>>> Thanks,
> >>>> Mickael
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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: About the WinAnsiEncoding error

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,
> Am 27.04.2018 um 14:24 schrieb Mickael Marrache <mi...@gmail.com>:
> 
> Hi Maruan,
> 
> You can download the PDF from here:
> 
> https://drive.google.com/open?id=13QCyxxZvYjRQ4I5tP4-6c7bAPCtsCaHz
> 
> The font is displayed as Embedded Subset - but in my case I have the David
> font on my system.

what happens is that if the form is filled using Adobe Reader then instead of only looking at the font information embedded in the PDF the embedded font program will also be used to find the "character". This will then be used as the new subset for the font in the field.

Have a look at https://stackoverflow.com/a/43002076/4690214 for a possible workaround.

BR
Maruan


> 
> Thanks,
> Mickael
> 
> On Fri, Apr 27, 2018 at 2:59 PM, Maruan Sahyoun <sa...@fileaffairs.de>
> wrote:
> 
>> 
>>> Am 27.04.2018 um 13:44 schrieb Mickael Marrache <
>> mickaelmarrache@gmail.com>:
>>> 
>>> This is what I meant by Document Properties, but it only shows you the
>>> fonts used by the document and tells if embedded or subset embedded, but
>>> nothing more.
>>> 
>>> I really don't understand why a PDF can be filled with Acrobat DC or
>> Reader
>>> but not with PDFBOX.
>>> 
>>> Assuming the font is installed on the system (in my case Windows) and is
>>> not embedded, both Acrobat and PDFBOX should have access to the font on
>>> this system.
>> 
>> PDFBox doesn't look for additional fonts if the font is embedded. It
>> simply tries to use the font which is part of the PDF. What happens if the
>> PDF is distributed to someone who doesn't have the font installed? Could
>> you share the PDF on a public location? As I don't have the font installed
>> I would be interested to try filling it with Adobe Reader/Acrobat to see
>> what might be used instead.
>> 
>> BR
>> Maruan
>> 
>>> 
>>> What information is missing to PDFBOX to properly set the value?
>>> 
>>> I'm aware of this issue since a year but can't find any information on
>> it.
>>> 
>>> On Fri, Apr 27, 2018 at 2:05 PM, Hartmann Toël <
>> Toel.Hartmann@elanders.com>
>>> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I am not sure, but
>>>> 
>>>> https://helpx.adobe.com/acrobat/using/pdf-fonts.html
>>>> 
>>>> says
>>>> File > Properties > Font tab
>>>> 
>>>> Does this help?
>>>> 
>>>> 
>>>> 
>>>> *  m3 developer*
>>>> Elanders Sverige AB
>>>> Phone Switchboard: +46 31 750 00 00
>>>> Phone direct: +46 31 750 08 86
>>>> E-mail: toel.hartmann@elanders.com
>>>> Homepage: www.elanders.se
>>>> 
>>>> On 27 apr 2018, at 10:56, Mickael Marrache <mi...@gmail.com>
>>>> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> Do you know a way to cause it to fully embed the font?
>>>> 
>>>> Mickael
>>>> 
>>>> On Fri, Apr 27, 2018 at 11:46 AM, Hartmann Toël <
>>>> Toel.Hartmann@elanders.com>
>>>> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> It seems Acrobat is only embedding the glyph used in your text as a
>>>> subset, the complete font is not included.
>>>> 
>>>> Could that be the problem?
>>>> 
>>>> /Toël
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> *  m3 developer*
>>>> 
>>>> Elanders Sverige AB
>>>> Phone Switchboard: +46 31 750 00 00
>>>> Phone direct: +46 31 750 08 86
>>>> E-mail: toel.hartmann@elanders.com
>>>> Homepage: www.elanders.se
>>>> 
>>>> On 27 apr 2018, at 10:39, Mickael Marrache <mi...@gmail.com>
>>>> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I created a blank PDF with Acrobat Pro DC. I added one text field with
>> font
>>>> David. I filled the text field using Acrobat so that it displays the
>> David
>>>> font in the fonts section (in Document Properties window). Then, I
>> applied
>>>> fixup "Embed missing fonts" via the Preflight menu.
>>>> 
>>>> When I look at the fonts list (in Document Properties), I can see the
>> David
>>>> font with the following properties:
>>>> 
>>>> David (Embedded Subset)
>>>> Type: TrueType (CID)
>>>> Encoding: Identity-H
>>>> 
>>>> When I try to set a value containing Hebrew characters using PDF box, I
>> get
>>>> the following error:
>>>> 
>>>> java.lang.IllegalArgumentException: U+05D0 is not available in this
>> font's
>>>> encoding: WinAnsiEncoding
>>>> at
>>>> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(
>>>> PDTrueTypeFont.java:399)
>>>> at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
>>>> at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(
>> PDFont.java:352)
>>>> 
>>>> I already know the workaround of embedding a font before setting the
>> value
>>>> but I'm trying to understand what is going on here. I understand the
>> Hebrew
>>>> characters are not in the WinAnsiEncoding but why this encoding is used
>> at
>>>> the first place?
>>>> 
>>>> Thanks,
>>>> Mickael
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> 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: About the WinAnsiEncoding error

Posted by Mickael Marrache <mi...@gmail.com>.
Hi Maruan,

You can download the PDF from here:

https://drive.google.com/open?id=13QCyxxZvYjRQ4I5tP4-6c7bAPCtsCaHz

The font is displayed as Embedded Subset - but in my case I have the David
font on my system.

Thanks,
Mickael

On Fri, Apr 27, 2018 at 2:59 PM, Maruan Sahyoun <sa...@fileaffairs.de>
wrote:

>
> > Am 27.04.2018 um 13:44 schrieb Mickael Marrache <
> mickaelmarrache@gmail.com>:
> >
> > This is what I meant by Document Properties, but it only shows you the
> > fonts used by the document and tells if embedded or subset embedded, but
> > nothing more.
> >
> > I really don't understand why a PDF can be filled with Acrobat DC or
> Reader
> > but not with PDFBOX.
> >
> > Assuming the font is installed on the system (in my case Windows) and is
> > not embedded, both Acrobat and PDFBOX should have access to the font on
> > this system.
>
> PDFBox doesn't look for additional fonts if the font is embedded. It
> simply tries to use the font which is part of the PDF. What happens if the
> PDF is distributed to someone who doesn't have the font installed? Could
> you share the PDF on a public location? As I don't have the font installed
> I would be interested to try filling it with Adobe Reader/Acrobat to see
> what might be used instead.
>
> BR
> Maruan
>
> >
> > What information is missing to PDFBOX to properly set the value?
> >
> > I'm aware of this issue since a year but can't find any information on
> it.
> >
> > On Fri, Apr 27, 2018 at 2:05 PM, Hartmann Toël <
> Toel.Hartmann@elanders.com>
> > wrote:
> >
> >> Hi,
> >>
> >> I am not sure, but
> >>
> >> https://helpx.adobe.com/acrobat/using/pdf-fonts.html
> >>
> >> says
> >> File > Properties > Font tab
> >>
> >> Does this help?
> >>
> >>
> >>
> >> *  m3 developer*
> >> Elanders Sverige AB
> >> Phone Switchboard: +46 31 750 00 00
> >> Phone direct: +46 31 750 08 86
> >> E-mail: toel.hartmann@elanders.com
> >> Homepage: www.elanders.se
> >>
> >> On 27 apr 2018, at 10:56, Mickael Marrache <mi...@gmail.com>
> >> wrote:
> >>
> >> Hi,
> >>
> >> Do you know a way to cause it to fully embed the font?
> >>
> >> Mickael
> >>
> >> On Fri, Apr 27, 2018 at 11:46 AM, Hartmann Toël <
> >> Toel.Hartmann@elanders.com>
> >> wrote:
> >>
> >> Hi,
> >>
> >> It seems Acrobat is only embedding the glyph used in your text as a
> >> subset, the complete font is not included.
> >>
> >> Could that be the problem?
> >>
> >> /Toël
> >>
> >>
> >>
> >>
> >>
> >> *  m3 developer*
> >>
> >> Elanders Sverige AB
> >> Phone Switchboard: +46 31 750 00 00
> >> Phone direct: +46 31 750 08 86
> >> E-mail: toel.hartmann@elanders.com
> >> Homepage: www.elanders.se
> >>
> >> On 27 apr 2018, at 10:39, Mickael Marrache <mi...@gmail.com>
> >> wrote:
> >>
> >> Hi,
> >>
> >> I created a blank PDF with Acrobat Pro DC. I added one text field with
> font
> >> David. I filled the text field using Acrobat so that it displays the
> David
> >> font in the fonts section (in Document Properties window). Then, I
> applied
> >> fixup "Embed missing fonts" via the Preflight menu.
> >>
> >> When I look at the fonts list (in Document Properties), I can see the
> David
> >> font with the following properties:
> >>
> >> David (Embedded Subset)
> >> Type: TrueType (CID)
> >> Encoding: Identity-H
> >>
> >> When I try to set a value containing Hebrew characters using PDF box, I
> get
> >> the following error:
> >>
> >> java.lang.IllegalArgumentException: U+05D0 is not available in this
> font's
> >> encoding: WinAnsiEncoding
> >> at
> >> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(
> >> PDTrueTypeFont.java:399)
> >> at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
> >> at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(
> PDFont.java:352)
> >>
> >> I already know the workaround of embedding a font before setting the
> value
> >> but I'm trying to understand what is going on here. I understand the
> Hebrew
> >> characters are not in the WinAnsiEncoding but why this encoding is used
> at
> >> the first place?
> >>
> >> Thanks,
> >> Mickael
> >>
> >>
> >>
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Re: About the WinAnsiEncoding error

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
> Am 27.04.2018 um 13:44 schrieb Mickael Marrache <mi...@gmail.com>:
> 
> This is what I meant by Document Properties, but it only shows you the
> fonts used by the document and tells if embedded or subset embedded, but
> nothing more.
> 
> I really don't understand why a PDF can be filled with Acrobat DC or Reader
> but not with PDFBOX.
> 
> Assuming the font is installed on the system (in my case Windows) and is
> not embedded, both Acrobat and PDFBOX should have access to the font on
> this system.

PDFBox doesn't look for additional fonts if the font is embedded. It simply tries to use the font which is part of the PDF. What happens if the PDF is distributed to someone who doesn't have the font installed? Could you share the PDF on a public location? As I don't have the font installed I would be interested to try filling it with Adobe Reader/Acrobat to see what might be used instead.

BR
Maruan

> 
> What information is missing to PDFBOX to properly set the value?
> 
> I'm aware of this issue since a year but can't find any information on it.
> 
> On Fri, Apr 27, 2018 at 2:05 PM, Hartmann Toël <To...@elanders.com>
> wrote:
> 
>> Hi,
>> 
>> I am not sure, but
>> 
>> https://helpx.adobe.com/acrobat/using/pdf-fonts.html
>> 
>> says
>> File > Properties > Font tab
>> 
>> Does this help?
>> 
>> 
>> 
>> *  m3 developer*
>> Elanders Sverige AB
>> Phone Switchboard: +46 31 750 00 00
>> Phone direct: +46 31 750 08 86
>> E-mail: toel.hartmann@elanders.com
>> Homepage: www.elanders.se
>> 
>> On 27 apr 2018, at 10:56, Mickael Marrache <mi...@gmail.com>
>> wrote:
>> 
>> Hi,
>> 
>> Do you know a way to cause it to fully embed the font?
>> 
>> Mickael
>> 
>> On Fri, Apr 27, 2018 at 11:46 AM, Hartmann Toël <
>> Toel.Hartmann@elanders.com>
>> wrote:
>> 
>> Hi,
>> 
>> It seems Acrobat is only embedding the glyph used in your text as a
>> subset, the complete font is not included.
>> 
>> Could that be the problem?
>> 
>> /Toël
>> 
>> 
>> 
>> 
>> 
>> *  m3 developer*
>> 
>> Elanders Sverige AB
>> Phone Switchboard: +46 31 750 00 00
>> Phone direct: +46 31 750 08 86
>> E-mail: toel.hartmann@elanders.com
>> Homepage: www.elanders.se
>> 
>> On 27 apr 2018, at 10:39, Mickael Marrache <mi...@gmail.com>
>> wrote:
>> 
>> Hi,
>> 
>> I created a blank PDF with Acrobat Pro DC. I added one text field with font
>> David. I filled the text field using Acrobat so that it displays the David
>> font in the fonts section (in Document Properties window). Then, I applied
>> fixup "Embed missing fonts" via the Preflight menu.
>> 
>> When I look at the fonts list (in Document Properties), I can see the David
>> font with the following properties:
>> 
>> David (Embedded Subset)
>> Type: TrueType (CID)
>> Encoding: Identity-H
>> 
>> When I try to set a value containing Hebrew characters using PDF box, I get
>> the following error:
>> 
>> java.lang.IllegalArgumentException: U+05D0 is not available in this font's
>> encoding: WinAnsiEncoding
>> at
>> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(
>> PDTrueTypeFont.java:399)
>> at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
>> at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:352)
>> 
>> I already know the workaround of embedding a font before setting the value
>> but I'm trying to understand what is going on here. I understand the Hebrew
>> characters are not in the WinAnsiEncoding but why this encoding is used at
>> the first place?
>> 
>> Thanks,
>> Mickael
>> 
>> 
>> 
>> 
>> 


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


Re: About the WinAnsiEncoding error

Posted by Mickael Marrache <mi...@gmail.com>.
This is what I meant by Document Properties, but it only shows you the
fonts used by the document and tells if embedded or subset embedded, but
nothing more.

I really don't understand why a PDF can be filled with Acrobat DC or Reader
but not with PDFBOX.

Assuming the font is installed on the system (in my case Windows) and is
not embedded, both Acrobat and PDFBOX should have access to the font on
this system.

What information is missing to PDFBOX to properly set the value?

I'm aware of this issue since a year but can't find any information on it.

On Fri, Apr 27, 2018 at 2:05 PM, Hartmann Toël <To...@elanders.com>
wrote:

> Hi,
>
> I am not sure, but
>
> https://helpx.adobe.com/acrobat/using/pdf-fonts.html
>
> says
> File > Properties > Font tab
>
> Does this help?
>
>
>
> *  m3 developer*
>  Elanders Sverige AB
>  Phone Switchboard: +46 31 750 00 00
>  Phone direct: +46 31 750 08 86
>  E-mail: toel.hartmann@elanders.com
>  Homepage: www.elanders.se
>
> On 27 apr 2018, at 10:56, Mickael Marrache <mi...@gmail.com>
> wrote:
>
> Hi,
>
> Do you know a way to cause it to fully embed the font?
>
> Mickael
>
> On Fri, Apr 27, 2018 at 11:46 AM, Hartmann Toël <
> Toel.Hartmann@elanders.com>
> wrote:
>
> Hi,
>
> It seems Acrobat is only embedding the glyph used in your text as a
> subset, the complete font is not included.
>
> Could that be the problem?
>
> /Toël
>
>
>
>
>
> *  m3 developer*
>
> Elanders Sverige AB
> Phone Switchboard: +46 31 750 00 00
> Phone direct: +46 31 750 08 86
> E-mail: toel.hartmann@elanders.com
> Homepage: www.elanders.se
>
> On 27 apr 2018, at 10:39, Mickael Marrache <mi...@gmail.com>
> wrote:
>
> Hi,
>
> I created a blank PDF with Acrobat Pro DC. I added one text field with font
> David. I filled the text field using Acrobat so that it displays the David
> font in the fonts section (in Document Properties window). Then, I applied
> fixup "Embed missing fonts" via the Preflight menu.
>
> When I look at the fonts list (in Document Properties), I can see the David
> font with the following properties:
>
> David (Embedded Subset)
> Type: TrueType (CID)
> Encoding: Identity-H
>
> When I try to set a value containing Hebrew characters using PDF box, I get
> the following error:
>
> java.lang.IllegalArgumentException: U+05D0 is not available in this font's
> encoding: WinAnsiEncoding
> at
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(
> PDTrueTypeFont.java:399)
> at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
> at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:352)
>
> I already know the workaround of embedding a font before setting the value
> but I'm trying to understand what is going on here. I understand the Hebrew
> characters are not in the WinAnsiEncoding but why this encoding is used at
> the first place?
>
> Thanks,
> Mickael
>
>
>
>
>

Re: About the WinAnsiEncoding error

Posted by Hartmann Toël <To...@elanders.com>.
Hi,

I am not sure, but

https://helpx.adobe.com/acrobat/using/pdf-fonts.html

says
File > Properties > Font tab

Does this help?

[cid:image001.png@01CF299E.7E3B49A0]


 m3 developer
 Elanders Sverige AB
 Phone Switchboard: +46 31 750 00 00
 Phone direct: +46 31 750 08 86
 E-mail: toel.hartmann@elanders.com<ma...@elanders.com>
 Homepage: www.elanders.se<http://www.elanders.se>

On 27 apr 2018, at 10:56, Mickael Marrache <mi...@gmail.com>> wrote:

Hi,

Do you know a way to cause it to fully embed the font?

Mickael

On Fri, Apr 27, 2018 at 11:46 AM, Hartmann Toël <To...@elanders.com>>
wrote:

Hi,

It seems Acrobat is only embedding the glyph used in your text as a
subset, the complete font is not included.

Could that be the problem?

/Toël





*  m3 developer*
Elanders Sverige AB
Phone Switchboard: +46 31 750 00 00
Phone direct: +46 31 750 08 86
E-mail: toel.hartmann@elanders.com<ma...@elanders.com>
Homepage: www.elanders.se<http://www.elanders.se>

On 27 apr 2018, at 10:39, Mickael Marrache <mi...@gmail.com>>
wrote:

Hi,

I created a blank PDF with Acrobat Pro DC. I added one text field with font
David. I filled the text field using Acrobat so that it displays the David
font in the fonts section (in Document Properties window). Then, I applied
fixup "Embed missing fonts" via the Preflight menu.

When I look at the fonts list (in Document Properties), I can see the David
font with the following properties:

David (Embedded Subset)
Type: TrueType (CID)
Encoding: Identity-H

When I try to set a value containing Hebrew characters using PDF box, I get
the following error:

java.lang.IllegalArgumentException: U+05D0 is not available in this font's
encoding: WinAnsiEncoding
at
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(
PDTrueTypeFont.java:399)
at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:352)

I already know the workaround of embedding a font before setting the value
but I'm trying to understand what is going on here. I understand the Hebrew
characters are not in the WinAnsiEncoding but why this encoding is used at
the first place?

Thanks,
Mickael





Re: About the WinAnsiEncoding error

Posted by Mickael Marrache <mi...@gmail.com>.
Hi,

Do you know a way to cause it to fully embed the font?

Mickael

On Fri, Apr 27, 2018 at 11:46 AM, Hartmann Toël <To...@elanders.com>
wrote:

> Hi,
>
> It seems Acrobat is only embedding the glyph used in your text as a
> subset, the complete font is not included.
>
> Could that be the problem?
>
> /Toël
>
>
>
>
>
> *  m3 developer*
>  Elanders Sverige AB
>  Phone Switchboard: +46 31 750 00 00
>  Phone direct: +46 31 750 08 86
>  E-mail: toel.hartmann@elanders.com
>  Homepage: www.elanders.se
>
> On 27 apr 2018, at 10:39, Mickael Marrache <mi...@gmail.com>
> wrote:
>
> Hi,
>
> I created a blank PDF with Acrobat Pro DC. I added one text field with font
> David. I filled the text field using Acrobat so that it displays the David
> font in the fonts section (in Document Properties window). Then, I applied
> fixup "Embed missing fonts" via the Preflight menu.
>
> When I look at the fonts list (in Document Properties), I can see the David
> font with the following properties:
>
> David (Embedded Subset)
> Type: TrueType (CID)
> Encoding: Identity-H
>
> When I try to set a value containing Hebrew characters using PDF box, I get
> the following error:
>
> java.lang.IllegalArgumentException: U+05D0 is not available in this font's
> encoding: WinAnsiEncoding
> at
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(
> PDTrueTypeFont.java:399)
> at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
> at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:352)
>
> I already know the workaround of embedding a font before setting the value
> but I'm trying to understand what is going on here. I understand the Hebrew
> characters are not in the WinAnsiEncoding but why this encoding is used at
> the first place?
>
> Thanks,
> Mickael
>
>
>

Re: About the WinAnsiEncoding error

Posted by Hartmann Toël <To...@elanders.com>.
Hi,

It seems Acrobat is only embedding the glyph used in your text as a subset, the complete font is not included.

Could that be the problem?

/Toël



[cid:image001.png@01CF299E.7E3B49A0]


 m3 developer
 Elanders Sverige AB
 Phone Switchboard: +46 31 750 00 00
 Phone direct: +46 31 750 08 86
 E-mail: toel.hartmann@elanders.com<ma...@elanders.com>
 Homepage: www.elanders.se<http://www.elanders.se>

On 27 apr 2018, at 10:39, Mickael Marrache <mi...@gmail.com>> wrote:

Hi,

I created a blank PDF with Acrobat Pro DC. I added one text field with font
David. I filled the text field using Acrobat so that it displays the David
font in the fonts section (in Document Properties window). Then, I applied
fixup "Embed missing fonts" via the Preflight menu.

When I look at the fonts list (in Document Properties), I can see the David
font with the following properties:

David (Embedded Subset)
Type: TrueType (CID)
Encoding: Identity-H

When I try to set a value containing Hebrew characters using PDF box, I get
the following error:

java.lang.IllegalArgumentException: U+05D0 is not available in this font's
encoding: WinAnsiEncoding
at
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(PDTrueTypeFont.java:399)
at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:352)

I already know the workaround of embedding a font before setting the value
but I'm trying to understand what is going on here. I understand the Hebrew
characters are not in the WinAnsiEncoding but why this encoding is used at
the first place?

Thanks,
Mickael