Ecrion Software Inc. Homepage
Forum Home Forum Home > Ecrion Digital Assembly Line (DAL) > Generic Support
  New Posts New Posts RSS Feed: Applying overlay to even/odd pages in a document
  FAQ FAQ  Forum Search   Register Register  Login Login

Applying overlay to even/odd pages in a document

 Post Reply Post Reply
Author
Message / View First Unread Post
mattucg View Drop Down
Newbie
Newbie
Avatar

Joined: 28 Sep 2010
Posts: 32
Post Options Post Options   Quote mattucg Quote  Post ReplyReply Direct Link To This Post Topic: Applying overlay to even/odd pages in a document
    Posted: 09 Sep 2011 at 2:59pm
I have several documents in DAL job, and I would like to apply an overlay to each document separately. Each document has two different overlays. One for odd pages and one for even pages. I am able to do this with if I use even/odd rule and exclude every other doc, but with many documents, the exclude list gets too long. I tried using 'include' instead, but the overlay is then applied to all even pages as well as the desired doc. Here is an example DAL (with only two docs) that is not working:


<xfj:job xmlns:xfj="http://www.ecrion.com/xfj/1.0">
    <xfj:output mime-type="application/pdf"/>
    <xfj:overlay id="overlay1" z-index="1">
        <xfj:apply-rules>
            <xfj:match rule="include(Doc1)" />
            <xfj:match rule="even" />
        </xfj:apply-rules>
        <xfj:external-content src="url(C:\FO\Doc1even.fo)" />
    </xfj:overlay>
    <xfj:overlay id="overlay2" z-index="1">
        <xfj:apply-rules>
            <xfj:match rule="include(Doc1)" />
            <xfj:match rule="odd" />
        </xfj:apply-rules>
        <xfj:external-content src="url(C:\FO\Doc1odd.fo)" />
    </xfj:overlay>

    <xfj:document id="Doc1">
        <xfj:external-content src="url(C:\PDF\Doc1.pdf)" />
    </xfj:document>
    <xfj:document id="Doc2">
        <xfj:external-content src="url(C:\PDF\Doc2.pdf)" />
    </xfj:document>
</xfj:job>




Edited by mattucg - 09 Sep 2011 at 3:00pm
Back to Top
radup View Drop Down
Admin Group
Admin Group
Avatar
Adminstrator

Joined: 19 May 2008
Posts: 90
Post Options Post Options   Quote radup Quote  Post ReplyReply Direct Link To This Post Posted: 12 Sep 2011 at 10:13am
Hi mattucg,

You can use odd(DocumentID) and even(DocumentID) functions in match rule.
More information about xfj:match is available here: http://www.ecrion.com/Products/XFRenderingServer/XFUltrascaleHelp/xfjmatch.htm
When trying to satisfy the match condition, the server tries every one, in order, until one is satisfied. If no one is satisfied, then the overlay is not applied.

To obtain the functionality required you need to use the following syntax:
<xfj:job xmlns:xfj="http://www.ecrion.com/xfj/1.0">
    <xfj:output mime-type="application/pdf"/>
    
<xfj:overlay id="OddOverlayDoc1" z-index="1">
<xfj:apply-rules>
<xfj:match rule="odd(Doc1)" />
</xfj:apply-rules>
<xfj:external-content src="url(C:\FO\Doc1odd.fo)"/>
</xfj:overlay>
<xfj:overlay id="EvenOverlayDoc1" z-index="1">
<xfj:apply-rules>
<xfj:match rule="even(Doc1)" />
</xfj:apply-rules>
<xfj:external-content src="url(C:\FO\Doc1even.fo)"/>
</xfj:overlay>
<xfj:overlay id="OddOverlayDoc2" z-index="1">
<xfj:apply-rules>
<xfj:match rule="odd(Doc2)" />
</xfj:apply-rules>
<xfj:external-content src="url(C:\FO\Doc2odd.fo)"/>
</xfj:overlay>
<xfj:overlay id="EvenOverlayDoc2" z-index="1">
<xfj:apply-rules>
<xfj:match rule="even(Doc2)" />
</xfj:apply-rules>
<xfj:external-content src="url(C:\FO\Doc2even.fo)"/>
</xfj:overlay>

    <xfj:document id="Doc1">
        <xfj:external-content src="url(C:\PDF\Doc1.pdf)" />
    </xfj:document>
    <xfj:document id="Doc2">
        <xfj:external-content src="url(C:\PDF\Doc2.pdf)" />
    </xfj:document>
</xfj:job>



Edited by radup - 12 Sep 2011 at 10:15am
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz

This page was generated in 0.125 seconds.