You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by uc...@kobelcosys.co.jp on 2021/07/28 07:10:33 UTC

the font of image is differnet every time

In our system we want to use PDFBox to change Japanese's PDF to image.
But we found that the font of image is different from the font of PDF, and 
the font of image is differnet every time.

--------------------------------------------------------------------------------------------------------------------------------------------------
Log : 
   Jul 21 17:48:26 document-upload-352-5l2qc document-upload WARN Using 
fallback font YuGothic-Bold for CID-keyed TrueType font MS明朝
       Jul 21 
13:39:07 document-upload-350-h4cxx document-upload WARN Using fallback 
font MS-Mincho for CID-keyed TrueType font MS明朝
--------------------------------------------------------------------------------------------------------------------------------------------------

When we investigate the probles,we also found the the order of font list 
after pdfbox processing is different every time after the server started.
  Coding : List<URI> fonts = fontFileFinder.find();

font of PDF for test:MS-Mincho(MS明朝)

Server start1   Order of font list:[游ゴシックMedium, 游ゴシック, 游明朝
Demibold, 游ゴシックLight, MS明朝, MSゴシック, 游明朝, 游明朝Light]
        The font pdfbox processed MS-Mincho

Server start2   Order of font list:[游ゴシックMedium, 游ゴシック, 游明朝
Demibold, 游ゴシックLight, MSゴシック, MS明朝, 游明朝, 游明朝Light]
        The font pdfbox processed YuGothic-Bold

Server start3   Order of font list:[游ゴシックMedium, 游ゴシック, 游明朝
Demibold, 游ゴシックLight, MSゴシック, MS明朝, 游明朝, 游明朝Light]
        The font pdfbox processed YuGothic-Bold


pdfbox version :2.0.23

1) Why the font of image is different  from the font of PDF.
2) Why the order of font list is different

Uchida

--------------------------------------------------
コベルコシステム株式会社
ソリューション事業部
インダストリーソリューション本部
第2開発部 第2グループ
   内田 一之(ウチダカズユキ) 
 TEL:080-9594-1560
  E-mail:uchida.kazuyuki@kobelcosys.co.jp
---------------------------------------------------

Re: the font of image is differnet every time

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,

You could try to implement your own FontMapper and assign it with  
FontMappers.set().

But usually the fallback fonts are pretty good. (needed for PDFs that  
don't have their fonts embedded)

MS Mincho might be good one purpose, but you don't know whether it is  
good for others, e.g. an arabic or an indian text.

Tilman

Am 28.07.2021 um 14:19 schrieb uchida.kazuyuki@kobelcosys.co.jp:
> Hi ;
>
> Is it possible to specify a fixed font and convert it to JPEG in the case
> of a font that is not defined on the server by referring to the target
> font of pdf?
> For example, in the case of a font that is not defined on the server,
> specify the font of MS Mincho and convert it to JPEG.
>
> Uchida
>
> --------------------------------------------------
> コベルコシステム株式会社
> ソリューション事業部
> インダストリーソリューション本部
> 第2開発部 第2グループ
>    内田 一之(ウチダカズユキ)
>  TEL:080-9594-1560
>    E-mail:uchida.kazuyuki@kobelcosys.co.jp
> ---------------------------------------------------
>
>
>
> 送信元: Tilman Hausherr <TH...@t-online.de>
> 宛先:   users@pdfbox.apache.org
> 日付:   2021/07/28 16:55
> 件名:   Re: the font of image is differnet every time
>
>
>
> Hi,
>
> Java itself should is assumed to be deterministic...My guess is that the
> directory list gives a different order each time.
>
> What you could do is to install the missing font MS明朝 on that server.
> If this is a scenario with a prebuilt image, then consider doing a run,
> then taking care that the file .pdfbox.cache is part of the image.
>
> Tilman
>
> Am 28.07.2021 um 09:10 schrieb uchida.kazuyuki@kobelcosys.co.jp:
>> In our system we want to use PDFBox to change Japanese's PDF to image.
>> But we found that the font of image is different from the font of PDF,
> and
>> the font of image is differnet every time.
>>
>>
> --------------------------------------------------------------------------------------------------------------------------------------------------
>> Log :
>>    Jul 21 17:48:26 document-upload-352-5l2qc document-upload WARN
> Using
>> fallback font YuGothic-Bold for CID-keyed TrueType font MS明朝
>>          Jul 21
>> 13:39:07 document-upload-350-h4cxx document-upload WARN Using fallback
>> font MS-Mincho for CID-keyed TrueType font MS明朝
>>
> --------------------------------------------------------------------------------------------------------------------------------------------------
>> When we investigate the probles,we also found the the order of font list
>> after pdfbox processing is different every time after the server
> started.
>>     Coding : List<URI> fonts = fontFileFinder.find();
>>
>> font of PDF for test:MS-Mincho(MS明朝)
>>
>> Server start1   Order of font list:[游ゴシックMedium, 游ゴシック, 游明
> 朝
>> Demibold, 游ゴシックLight, MS明朝, MSゴシック, 游明朝, 游明朝Light]
>>           The font pdfbox processed MS-Mincho
>>
>> Server start2   Order of font list:[游ゴシックMedium, 游ゴシック, 游明
> 朝
>> Demibold, 游ゴシックLight, MSゴシック, MS明朝, 游明朝, 游明朝Light]
>>           The font pdfbox processed YuGothic-Bold
>>
>> Server start3   Order of font list:[游ゴシックMedium, 游ゴシック, 游明
> 朝
>> Demibold, 游ゴシックLight, MSゴシック, MS明朝, 游明朝, 游明朝Light]
>>           The font pdfbox processed YuGothic-Bold
>>
>>
>> pdfbox version :2.0.23
>>
>> 1) Why the font of image is different  from the font of PDF.
>> 2) Why the order of font list is different
>>
>> Uchida
>>
>> --------------------------------------------------
>> コベルコシステム株式会社
>> ソリューション事業部
>> インダストリーソリューション本部
>> 第2開発部 第2グループ
>>    内田 一之(ウチダカズユキ)
>>  TEL:080-9594-1560
>>     E-mail:uchida.kazuyuki@kobelcosys.co.jp
>> ---------------------------------------------------
>>
>
> ---------------------------------------------------------------------
> 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: the font of image is differnet every time

Posted by uc...@kobelcosys.co.jp.
Hi ;

Is it possible to specify a fixed font and convert it to JPEG in the case 
of a font that is not defined on the server by referring to the target 
font of pdf?
For example, in the case of a font that is not defined on the server, 
specify the font of MS Mincho and convert it to JPEG.

Uchida

--------------------------------------------------
コベルコシステム株式会社
ソリューション事業部
インダストリーソリューション本部
第2開発部 第2グループ
   内田 一之(ウチダカズユキ) 
 TEL:080-9594-1560
  E-mail:uchida.kazuyuki@kobelcosys.co.jp
---------------------------------------------------



送信元: Tilman Hausherr <TH...@t-online.de>
宛先:   users@pdfbox.apache.org
日付:   2021/07/28 16:55
件名:   Re: the font of image is differnet every time



Hi,

Java itself should is assumed to be deterministic...My guess is that the 
directory list gives a different order each time.

What you could do is to install the missing font MS明朝 on that server.
If this is a scenario with a prebuilt image, then consider doing a run, 
then taking care that the file .pdfbox.cache is part of the image.

Tilman

Am 28.07.2021 um 09:10 schrieb uchida.kazuyuki@kobelcosys.co.jp:
> In our system we want to use PDFBox to change Japanese's PDF to image.
> But we found that the font of image is different from the font of PDF, 
and
> the font of image is differnet every time.
>
> 
--------------------------------------------------------------------------------------------------------------------------------------------------
> Log :
>    Jul 21 17:48:26 document-upload-352-5l2qc document-upload WARN 
Using
> fallback font YuGothic-Bold for CID-keyed TrueType font MS明朝
>         Jul 21
> 13:39:07 document-upload-350-h4cxx document-upload WARN Using fallback
> font MS-Mincho for CID-keyed TrueType font MS明朝
> 
--------------------------------------------------------------------------------------------------------------------------------------------------
>
> When we investigate the probles,we also found the the order of font list
> after pdfbox processing is different every time after the server 
started.
>    Coding : List<URI> fonts = fontFileFinder.find();
>
> font of PDF for test:MS-Mincho(MS明朝)
>
> Server start1   Order of font list:[游ゴシックMedium, 游ゴシック, 游明
朝
> Demibold, 游ゴシックLight, MS明朝, MSゴシック, 游明朝, 游明朝Light]
>          The font pdfbox processed MS-Mincho
>
> Server start2   Order of font list:[游ゴシックMedium, 游ゴシック, 游明
朝
> Demibold, 游ゴシックLight, MSゴシック, MS明朝, 游明朝, 游明朝Light]
>          The font pdfbox processed YuGothic-Bold
>
> Server start3   Order of font list:[游ゴシックMedium, 游ゴシック, 游明
朝
> Demibold, 游ゴシックLight, MSゴシック, MS明朝, 游明朝, 游明朝Light]
>          The font pdfbox processed YuGothic-Bold
>
>
> pdfbox version :2.0.23
>
> 1) Why the font of image is different  from the font of PDF.
> 2) Why the order of font list is different
>
> Uchida
>
> --------------------------------------------------
> コベルコシステム株式会社
> ソリューション事業部
> インダストリーソリューション本部
> 第2開発部 第2グループ
>    内田 一之(ウチダカズユキ)
>  TEL:080-9594-1560
>    E-mail:uchida.kazuyuki@kobelcosys.co.jp
> ---------------------------------------------------
>


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





Re: the font of image is differnet every time

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,

Java itself should is assumed to be deterministic...My guess is that the  
directory list gives a different order each time.

What you could do is to install the missing font MS明朝 on that server.
If this is a scenario with a prebuilt image, then consider doing a run,  
then taking care that the file .pdfbox.cache is part of the image.

Tilman

Am 28.07.2021 um 09:10 schrieb uchida.kazuyuki@kobelcosys.co.jp:
> In our system we want to use PDFBox to change Japanese's PDF to image.
> But we found that the font of image is different from the font of PDF, and
> the font of image is differnet every time.
>
> --------------------------------------------------------------------------------------------------------------------------------------------------
> Log :
>    Jul 21 17:48:26 document-upload-352-5l2qc document-upload WARN Using
> fallback font YuGothic-Bold for CID-keyed TrueType font MS明朝
>         Jul 21
> 13:39:07 document-upload-350-h4cxx document-upload WARN Using fallback
> font MS-Mincho for CID-keyed TrueType font MS明朝
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
> When we investigate the probles,we also found the the order of font list
> after pdfbox processing is different every time after the server started.
>    Coding : List<URI> fonts = fontFileFinder.find();
>
> font of PDF for test:MS-Mincho(MS明朝)
>
> Server start1   Order of font list:[游ゴシックMedium, 游ゴシック, 游明朝
> Demibold, 游ゴシックLight, MS明朝, MSゴシック, 游明朝, 游明朝Light]
>          The font pdfbox processed MS-Mincho
>
> Server start2   Order of font list:[游ゴシックMedium, 游ゴシック, 游明朝
> Demibold, 游ゴシックLight, MSゴシック, MS明朝, 游明朝, 游明朝Light]
>          The font pdfbox processed YuGothic-Bold
>
> Server start3   Order of font list:[游ゴシックMedium, 游ゴシック, 游明朝
> Demibold, 游ゴシックLight, MSゴシック, MS明朝, 游明朝, 游明朝Light]
>          The font pdfbox processed YuGothic-Bold
>
>
> pdfbox version :2.0.23
>
> 1) Why the font of image is different  from the font of PDF.
> 2) Why the order of font list is different
>
> Uchida
>
> --------------------------------------------------
> コベルコシステム株式会社
> ソリューション事業部
> インダストリーソリューション本部
> 第2開発部 第2グループ
>    内田 一之(ウチダカズユキ)
>  TEL:080-9594-1560
>    E-mail:uchida.kazuyuki@kobelcosys.co.jp
> ---------------------------------------------------
>


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