<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Are "XEP Intermediate Format" and
      "XEPOUT" the same thing? Not defined in text below.<br>
      <br>
      Thanks,<br>
      Mark<br>
      <br>
      On 2/26/2015 4:46 PM, Kevin Brown wrote:<br>
    </div>
    <blockquote cite="mid:026c01d05226$e3de5ca0$ab9b15e0$@renderx.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Oh, and I would
            note that you would need to change this at least to link to
            your own images.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Don’t try to
            just run this as is as you would insert a link to a
            non-existing image into the XEPOUT which is a fatal error
            and XEP would abort.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">It never
            expects that as XEPOUT is normally created by XEP and the
            images exist or point to the “not-found” image.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Mine in this
            XSL are pointing to:<br>
            <br>
          </span>src="cliser://localhost/F:/Desktop%20Files/CoolTools/DocNav/forward.png"<span
            style="color:#1F497D"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Which is
            XEPWin-speak (the cliser: protocol) pointing to an image
            file at “F:\Desktop Files\CoolTools\DocNav\forward.png”.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">But of course,
            you would have your own images or text, colors. You could
            even insert them into the original document without any link
            and then grab their coordinates to create the link.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Kevin Brown<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">RenderX<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b>From:</b> Xep-support
              [<a class="moz-txt-link-freetext" href="mailto:xep-support-bounces@renderx.com">mailto:xep-support-bounces@renderx.com</a>] <b>On Behalf Of
              </b>Kevin Brown<br>
              <b>Sent:</b> Thursday, February 26, 2015 4:28 PM<br>
              <b>To:</b> 'RenderX Community Support List'<br>
              <b>Subject:</b> [xep-support] CoolTool; Document
              Navigation Tool<o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Recently someone asked a great question,
          and great questions always get us thinking.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">They wanted to implement document
          navigation widgets like “Next Page” and “Previous Page”.<o:p></o:p></p>
        <p class="MsoNormal">Now, if they had licensed XEP with PDF
          Forms support, this is easy because you can inject PDF Form
          elements (like fillable fields, combos and buttons) in the
          document. <o:p></o:p></p>
        <p class="MsoNormal">You can also attach Javascript on such
          objects. Attaching a button in the PDF when pushed triggers
          Javascript engine in PDF to “turn the page” is easy.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">But they do not have the PDF Acroforms
          add-on to RenderX.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Not that I like *<b>not</b>* selling
          someone something, I thought about it for a minute. <o:p></o:p></p>
        <p class="MsoNormal">I tried to think of an
          internal-destination/id scenario that may work, and there
          could very well be one … but I am not sure. <o:p></o:p></p>
        <p class="MsoNormal">Maybe throwing markers throughput the
          document and some complicated scheme. <o:p></o:p></p>
        <p class="MsoNormal">But why try to create something in XSL FO
          (which is not page aware)?<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">One thing I did know, it would be easy in
          the XEP Intermediate Format to create it. It contains all
          there is to know about pages.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Let’s take a look at a few items in XEPOUT.
          First, what does it look like when there is an “anchor”
          something to latch onto?<o:p></o:p></p>
        <p class="MsoNormal">Well that is pretty easy, something like
          this:<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><xep:target x="0" y="792000"
          id="docnav-1" name="docnav-1"/><br>
          <xep:target x="0" y="792000" id="rx:last@docnav-1"
          name="rx:last@docnav-1"/><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The “x” and “y” coordinates contain the
          upper left corner of the anchor.<o:p></o:p></p>
        <p class="MsoNormal">The id and name are used internally to make
          a table of all the anchors.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Now, what about a link that goes to some
          internal destination?<o:p></o:p></p>
        <p class="MsoNormal">Again, easy, something like this:<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><xep:internal-link x-from="72000"
          y-from="736866" x-till="108000" y-till="747966"<br>
                      destination-id="docnav-1" destination="docnav-1"
          destination-x="64800"<br>
                      destination-y="727200"/><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The x-from, y-from, x-till, y-till are the
          bounding box of the clickable area.<o:p></o:p></p>
        <p class="MsoNormal">The destination-id is the id to go look for
          in the document and display.<o:p></o:p></p>
        <p class="MsoNormal">I am not going to go into some of the
          others, they are actually not that important.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Suffices to say that if the
          <xep:internal-link> area above is clicked (whose
          destination is “docnav-1”) , the point described by the
          <xep:target> above (whose id is “docnav-1”) would come
          into view. No matter where it is in the PDF.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Given that and a little knowledge of
          XEPOUT, we have everything we need to build something like a
          “page turner”. <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">And so, here it is. A simple XSL that would
          inject images into a PDF along with links to turn the pages of
          a PDF. It operates against the XEPOUT format, modifying it
          before you would give it back to the formatter to output the
          final PDF. You can of course do you own thing here, change the
          images, place them elsewhere, skip certain pages. It doesn’t
          do anything special but put forward and back buttons on every
          page (except back on 1 and forward on the last). <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Any questions? Write us! Or discuss here. <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal" style="margin-bottom:12.0pt"><?xml
          version="1.0" encoding="UTF-8"?><br>
          <xsl:stylesheet xmlns:xsl="<a moz-do-not-send="true"
            href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</a>"
          version="1.0"<br>
              xmlns:xep="<a moz-do-not-send="true"
            href="http://www.renderx.com/XEP/xep">http://www.renderx.com/XEP/xep</a>"><br>
              <!-- Not that you may have anything else named
          'docnav-#', this is here so you can change the name of the
          id's inserted if you like --><br>
              <xsl:variable name="pagestr" select="'docnav-'"/><br>
              <!-- Get the total number of pages in the document
          --><br>
              <xsl:variable name="totpages"
          select="count(//xep:page)"/><br>
              <xsl:template match="xep:page"><br>
                  <xep:page width="{@width}" height="{@height}"
          page-number="{@page-number}"<br>
                      page-id="{@page-id}"><br>
                      <!-- Add a destination on each page right after
          the xep:page --><br>
                      <xsl:variable name="page-number"
          select="count(preceding-sibling::xep:page) + 1"/><br>
                      <xsl:variable name="page-numid"
          select="concat($pagestr,$page-number)"/><br>
                      <xsl:variable name="page-height"
          select="@height"/><br>
                      <xep:target x="0" y="{$page-height}"
          id="{$page-numid}" name="{$page-numid}"/><br>
                      <xep:target x="0" y="{$page-height}"
          id="rx:last@{$page-numid}"<br>
                          name="rx:last@{$page-numid}"/><br>
                      <!-- Output everything on the page --><br>
                      <xsl:apply-templates/><br>
                      <!-- Then add the navigation buttons with logic
          to not add back on page 1 nor forward on the last page --><br>
                      <xsl:if test="$page-number &lt;
          $totpages"><br>
                          <xsl:variable name="forward-id"
          select="concat($pagestr,$page-number + 1)"/><br>
                          <xep:image
          src="cliser://localhost/F:/Desktop%20Files/CoolTools/DocNav/forward.png"<br>
                              type="image/png" x-from="504000"
          y-from="739350" scale-x="0.5" scale-y="0.5"<br>
                              width="36000" height="15000"/><br>
                          <xep:internal-link x-from="504000"
          y-from="736866" x-till="540000" y-till="747966"<br>
                              destination-id="{$forward-id}"
          destination="{$forward-id}" destination-x="64800"<br>
                              destination-y="727200"/><br>
                      </xsl:if><br>
                      <xsl:if test="$page-number &gt; 1"><br>
                          <xsl:variable name="back-id"
          select="concat($pagestr,$page-number - 1)"/><br>
                          <xep:image
          src="cliser://localhost/F:/Desktop%20Files/CoolTools/DocNav/back.png"<br>
                              type="image/png" x-from="72000"
          y-from="739350" scale-x="0.5" scale-y="0.5"<br>
                              width="36000" height="15000"/><br>
                          <xep:internal-link x-from="72000"
          y-from="736866" x-till="108000" y-till="747966"<br>
                              destination-id="{$back-id}"
          destination="{$back-id}" destination-x="64800"<br>
                              destination-y="727200"/><br>
                      </xsl:if><br>
                  </xep:page><br>
              </xsl:template><br>
              <xsl:template match="@* | *"><br>
                  <xsl:copy><br>
                      <xsl:apply-templates select="@* | *"/><br>
                  </xsl:copy><br>
              </xsl:template><br>
          <br>
          </xsl:stylesheet><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
(*) To unsubscribe, please visit <a class="moz-txt-link-freetext" href="http://lists.renderx.com/mailman/options/xep-support">http://lists.renderx.com/mailman/options/xep-support</a>
(*) By using the Service, you expressly agree to these Terms of Service <a class="moz-txt-link-freetext" href="http://w">http://w</a>
ww.renderx.com/terms-of-service.html</pre>
    </blockquote>
    <br>
  </body>
</html>