Re: Strange conversion of special character

Hussein Shafie <[email protected]> Fri, 16 Aug 2019 10:28:47 +0200
Newsgroups gmane.text.xml.xfc.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------94F601AFF177BA5E6860E17D
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Tim Butterworth wrote:
> I am struggling to locate a mailing list as I am indeed using ’server’.

It's [email protected]. See "Mailing Lists", 
https://www.xmlmind.com/foconverter/mailing_lists.html




> I am using xsl server pro 5.4.3 on a linux server, and generating PDF from the command line.
>

Sorry but XMLmind XSL-FO Converter version 5 is no longer supported.

See "Support policy", 
https://www.xmlmind.com/foconverter/support_policy.html
---
Also please note that we support only the last major version of the 
software. For example, if latest release is v7.2, we'll respond to 
support requests about v7.0, v7.1, v7.2, but not to those about v6.9. If 
you are using an old version, please upgrade to latest version and check 
whether this fixes the issue.
---




> I have tried changing the fonts in the XSL document definition to Arial but it has had no effect.
>

This is a first step, but Apache FOP, the XSL-FO processor you use to 
generate PDF, does not know anything about the Arial fonts. So what you 
did is currently ignored by Apache FOP.

May be what follows will work (not tested it, because in principle, I'm 
not allowed to help you):

1) Save attached FOP configuration file "fop.conf" somewhere:
---
<?xml version="1.0"?>
<fop>
   <renderers>
     <renderer mime="application/pdf">
       <fonts>
         <font embed-url="file:/usr/share/fonts/truetype/arial.ttf"
               kerning="yes">
           <font-triplet name="Arial" style="normal" weight="normal"/>
           <font-triplet name="sans-serif" style="normal" weight="normal"/>
         </font>
         <font embed-url="file:/usr/share/fonts/truetype/arialbd.ttf"
               kerning="yes">
           <font-triplet name="Arial" style="normal" weight="bold"/>
           <font-triplet name="sans-serif" style="normal" weight="bold"/>
         </font>
         <font embed-url="file:/usr/share/fonts/truetype/arialbi.ttf"
               kerning="yes">
           <font-triplet name="Arial" style="italic" weight="bold"/>
           <font-triplet name="sans-serif" style="italic" weight="bold"/>
         </font>
         <font embed-url="file:/usr/share/fonts/truetype/ariali.ttf"
               kerning="yes">
           <font-triplet name="Arial" style="italic" weight="normal"/>
           <font-triplet name="sans-serif" style="italic" weight="normal"/>
         </font>
       </fonts>
     </renderer>
   </renderers>
</fop>
---

Let's suppose you save it to "/opt/apache-tomcat-9.0.21/webapps/fop.conf"

2) IMPORTANT: Edit this configuration file to specify the actual 
locations of all "arial*.ttf" files.

3) Find a way to pass system property "XXE_FOP_CONFIG" to the XMLmind 
XSL Server

This system property should point to the location of the FOP 
configuration file, e.g.

-DXXE_FOP_CONFIG=/opt/apache-tomcat-9.0.21/webapps/fop.conf

Please specify an absolute file path here. A "file:" URL works too.

-DXXE_FOP_CONFIG=file:///opt/apache-tomcat-9.0.21/webapps/fop.conf



--> I'm really sorry but I will not help you more than this unless you 
upgrade to XMLmind XSL-FO Converter version 6.





Initial support request:
=========================================================================================================
On 08/09/2019 03:38 PM, Tim Butterworth wrote:
 >
 > I am having a slight issue with generating a PDF file using xmlmind
 > server which contains the character ş
 >
 >
 >
 > I generate both a DOCx word file and A pdf.
 >
 > - In the word file it works perfectly and renders ok;
 > - in the PDF file it just renders as #
 >
 > I have tried i the XML file to change the character to
 >
 > &#351;
 >
 > or
 > &#x015F;
 >
 > And the results are unchanged.
 >

This is a well-known PDF issue. You cannot use any of the standard PDF 
fonts (Helvetica, Times, Courier, etc) to convert a document containing 
characters such as &#x015F; as these standard PDF fonts contain very few 
glyphs.

This FAQ explains what is the problem (applies to PDF in general; I mean 
not specific to XMLmind) and how to solve it in the context of XMLmind 
XML Editor:

---
When I convert documents written in Russian (or Polish or Czech or any 
non-western language) to PDF, almost all characters are replaced by the 
"#" character. Is there a workaround for this problem?
---
https://www.xmlmind.com/xmleditor/faq.html#custom_pdf_fonts

If you are not using XMLmind XML Editor (you wrote "xmlmind server"), 
please send a support request to the corresponding mailing list. We need 
to know which product, which product version, which OS, which Java, etc, 
you are using.
=========================================================================================================

--------------94F601AFF177BA5E6860E17D
Content-Type: text/plain; charset=UTF-8;
 name="fop.conf"
Content-Transfer-Encoding: base64
Content-Disposition: attach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IG5hbWU9InNhbnMtc2Vy
aWYiIHN0eWxlPSJpdGFsaWMiIHdlaWdodD0iYm9sZCIvPgogICAgICAgIDwvZm9udD4KICAg
ICAgICA8Zm9udCBlbWJlZC11cmw9ImZpbGU6L3Vzci9zaGFyZS9mb250cy90cnVldHlwZS9h
cmlhbGkudHRmIgogICAgICAgICAgICAgIGtlcm5pbmc9InllcyI+CiAgICAgICAgICA8Zm9u
dC10cmlwbGV0IG5hbWU9IkFyaWFsIiBzdHlsZT0iaXRhbGljIiB3ZWlnaHQ9Im5vcm1hbCIv
PgogICAgICAgICAgPGZvbnQtdHJpcGxldCBuYW1lPSJzYW5zLXNlcmlmIiBzdHlsZT0iaXRh
bGljIiB3ZWlnaHQ9Im5vcm1hbCIvPgogICAgICAgIDwvZm9udD4KICAgICAgPC9mb250cz4K
ICAgIDwvcmVuZGVyZXI+CiAgPC9yZW5kZXJlcnM+CjwvZm9wPgo=
--------------94F601AFF177BA5E6860E17D
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--
XMLmind FO Converter Support List
[email protected]
https://www.xmlmind.com/mailman/listinfo/xfc-support
--------------94F601AFF177BA5E6860E17D--