Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to strip Unicode soft hyphen from PDF bookmarks generated using XSL-FO
    text
    copied!<p>I'm converting DITA maps to PDF using the DITA Open Toolkit 1.7 and RenderX XEP. In the DITA topics, product names are inserted using conrefs. One of my product names is quite long. It caused layout problems when used within tables. Therefore I inserted a soft hyphen into the phrase that is reused via conref:</p> <pre><code>&lt;ph id="PD_FineReader2Comp"&gt;DOXiS4 FineReader2&amp;#xad;Components&lt;/ph&gt; </code></pre> <p>This works nicely in the generated pages, but creates a problem in the bookmarks where a symbol is displayed in place of the soft hyphen. </p> <p><img src="https://i.stack.imgur.com/CQCLE.png" alt="enter image description here"></p> <p>Obviously, this is an encoding problem. It seems that UTF-8 characters are properly handled in PDF content, but not in PDF bookmarks where, according to the following sources, some PDF-16 characters can be used (but I did not understand which ones).</p> <ul> <li><a href="http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf" rel="nofollow noreferrer">http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf</a></li> <li><a href="http://www.setasign.de/support/tips-and-tricks/use-unicode-in-string-values/" rel="nofollow noreferrer">http://www.setasign.de/support/tips-and-tricks/use-unicode-in-string-values/</a></li> </ul> <p>The DITA Open Toolkit seems to create bookmarks from topic titles using this code fragment:</p> <pre><code> &lt;fo:bookmark&gt; &lt;xsl:attribute name="internal-destination"&gt; &lt;xsl:call-template name="generate-toc-id"/&gt; &lt;/xsl:attribute&gt; &lt;xsl:if test="$bookmarkStyle!='EXPANDED'"&gt; &lt;xsl:attribute name="starting-state"&gt;hide&lt;/xsl:attribute&gt; &lt;/xsl:if&gt; &lt;fo:bookmark-title&gt; &lt;xsl:value-of select="normalize-space($topicTitle)"/&gt; &lt;/fo:bookmark-title&gt; &lt;xsl:apply-templates mode="bookmark"/&gt; &lt;/fo:bookmark&gt; </code></pre> <p>The XSL stylesheet has version 2.0.</p> <p>I would like to create an override that removes the offending character. How can I do this?</p> <ul> <li>Is it possible to properly resolve the encoding problem? (Probably not possible).</li> <li>Are there any XSL functions or attributes which remove whitespace other than space, tab, linefeed, and carriage return?</li> <li>Or do I need special handling for the soft hyphen?</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload