Skip to main content
10-Marble
December 12, 2011
Question

Landscape pages Publish Upside Down

  • December 12, 2011
  • 17 replies
  • 2554 views

We have just upgraded to 6.0 M020. Since doing so the XSL-FO stylesheets that we use to produce landscape pages are publishing the pages as PDFs upside down. The page is set up as a 11x8.5. Has anyone else experienced this type of behavior? I have tested this using Print Composer and PE Server I get the same results with both.

Thanks in advance for all your help.


    17 replies

    1-Visitor
    December 12, 2011
    Is the entire page landscape or is it just the flowtext area? In other words, do the landscape pages have the header and footer on the long edge of the page or the short edge?
    10-Marble
    December 12, 2011
    The entire page is upside down. Header footer and all.



    sarah


    1-Visitor
    December 12, 2011
    Can you post the XSL-FO code that defines the page?
    -Brandon 🙂


    1-Visitor
    December 12, 2011
    Nevertheless, there are two ways to make a landscape page:

    1) Keep the header and footer on the short edge of the page and rotate only the text to landscape

    2) Rotate header, footer and text to landscape.

    Are your headers and footers (upside-down or not) on the narrow edge or the long edge of the page?
    10-Marble
    December 12, 2011
    We have a page defined for the first page and then one for all the rest. They all publish upside down.

    <fo:simple-page-master master-name="PageMaster-first" margin-top="0.50in" margin-bottom="0.50in" margin-left="0.25in" margin-right="0.25in" page-height="8.5in" page-width="11in">
    <fo:region-before region-name="header" extent="1.25in"/">
    <fo:region-start extent="0.25in"/">
    <fo:region-body margin-top="1.25in" margin-left="0.25in" margin-right="0.25in">
    <xsl:attribute name="margin-bottom">
    <xsl:value-of select="$margin"/"><xsl:value-of select="$unit"/">
    </xsl:attribute>
    </fo:region-body>
    <fo:region-after region-name="footer1st">
    <xsl:attribute name="extent">
    <xsl:value-of select="$margin"/"><xsl:value-of select="$unit"/">
    </xsl:attribute>
    </fo:region-after>
    <fo:region-end extent="0.25in"/">
    </fo:simple-page-master>

    <fo:simple-page-master master-name="PageMaster-all" margin-top="0.50in" margin-bottom="0.50in" margin-left="0.25in" margin-right="0.25in" page-height="8.5in" page-width="11in">
    <fo:region-before region-name="header" extent="1.25in"/">
    <fo:region-start extent="0.25in"/">
    <fo:region-body margin-top="1.25in" margin-bottom="0.55in" margin-left="0.25in" margin-right="0.25in"/">
    <fo:region-after region-name="footer" extent="0.50in"/">
    <fo:region-end extent="0.25in"/">
    </fo:simple-page-master>
    1-Visitor
    December 12, 2011
    That all looks reasonable. How about the code that invokes those
    pages? I'm guessing there may be an errant rotation applied,
    somewhere. The other possibility would be that a rotation is getting
    applied during PDF creation. Do you use Distiller or Direct PDF?

    This exact XSL-FO style sheet worked in a previous version? Which
    one? Any other changes at the same time (e.g., Distiller to Direct
    PDF or vice-versa)?

    -Brandon 🙂


    On Mon, Dec 12, 2011 at 8:26 AM, Price, Sarah CTR
    <sarah.r.price@uscg.mil> wrote:
    > We have a page defined for the first page and then one for all the rest. They all publish upside down.
    >
    > <fo:simple-page-master master-name="PageMaster-first" margin-top="0.50in" margin-bottom="0.50in" margin-left="0.25in" margin-right="0.25in" page-height="8.5in" page-width="11in">
    > <fo:region-before region-name="header" extent="1.25in"/">
    > <fo:region-start extent="0.25in"/">
    > <fo:region-body margin-top="1.25in" margin-left="0.25in" margin-right="0.25in">
    > <xsl:attribute name="margin-bottom">
    > <xsl:value-of select="$margin"/"><xsl:value-of select="$unit"/">
    > </xsl:attribute>
    > </fo:region-body>
    > <fo:region-after region-name="footer1st">
    > <xsl:attribute name="extent">
    > <xsl:value-of select="$margin"/"><xsl:value-of select="$unit"/">
    > </xsl:attribute>
    > </fo:region-after>
    > <fo:region-end extent="0.25in"/">
    > </fo:simple-page-master>
    >
    > <fo:simple-page-master master-name="PageMaster-all" margin-top="0.50in" margin-bottom="0.50in" margin-left="0.25in" margin-right="0.25in" page-height="8.5in" page-width="11in">
    > <fo:region-before region-name="header" extent="1.25in"/">
    > <fo:region-start extent="0.25in"/">
    > <fo:region-body margin-top="1.25in" margin-bottom="0.55in" margin-left="0.25in" margin-right="0.25in"/">
    > <fo:region-after region-name="footer" extent="0.50in"/">
    > <fo:region-end extent="0.25in"/">
    > </fo:simple-page-master>
    >
    10-Marble
    December 12, 2011
    We are using Distiller. I've tried this in Distiller version 9.4 and 7.1, same result in both. The version it worked in was Arbortext 5.3 M090. I use an ACL to call the publish function and correct stylesheet.

    Here is the publish part of the ACL. There was some package changes between the versions could it be something with the _pubpdf::run_distiller???:

    if ($allData)
    {
    set printstylesheet="AllData-fo.xsl";
    $psname = "c:\\_epictemp\\" . $model . "_alldata.ps"
    $pdfname = $outdir . $model . "_alldata.pdf"
    print composed wait printer="$useprinter" file="$psname";
    _pubpdf::run_distiller("$psname","$pdfname");
    message "Published All Data Report"
    $correct='1';
    remove_file "$psname";
    }

    Here is where it calls the Pagemaster:

    <xsl:template match="index">
    <fo:page-sequence master-reference="PageMaster" initial-page-number="1">
    ...
    <fo:flow flow-name="xsl-region-body" margin-top="1.00in">
    <fo:block-container>
    <fo:table border-style="solid" border-color="black" border-width="1pt">
    <fo:table-column column-width="0.50in"/">
    <fo:table-column column-width="0.50in"/">
    <fo:table-column column-width="0.75in"/">
    <fo:table-column column-width="0.70in"/">
    <fo:table-column column-width="2.25in"/">
    <fo:table-column column-width="0.80in"/">
    <fo:table-column column-width="0.75in"/">
    <fo:table-column column-width="1.00in"/">
    <fo:table-column column-width="1.00in"/">
    <fo:table-column column-width="1.75in"/">
    <fo:table-body>
    <xsl:apply-templates select="./item">
    <xsl:sort select="mpcnum"/">
    </xsl:apply-templates>
    </fo:table-body>
    </fo:table>
    </fo:block-container>
    1-Visitor
    December 12, 2011
    I'd try eliminating the variables one at a time. First, take your
    custom ACL out by just doing a "File", "Publish", "PDF File" and
    specifying your XSL-FO style sheet. You may not get the right overall
    result without your custom code, but if it exercises the landscape
    page code in your style sheet without the upside-down page problem,
    you'll know where to focus your efforts next.

    If you still get upside-down pages, try the same thing after a "set
    usedistiller=off" so that Direct PDF is used, instead.

    If that fails, too... I noticed you skipped some code between the
    fo:page-sequence and fo:flow starting tags. Are you sure there isn't
    anything fun and exciting going on there? 🙂

    -Brandon 🙂


    On Mon, Dec 12, 2011 at 10:13 AM, Price, Sarah CTR
    <sarah.r.price@uscg.mil> wrote:
    > We are using Distiller. I've tried this in Distiller version 9.4 and 7.1, same result in both. The version it worked in was Arbortext 5.3 M090. I use an ACL to call the publish function and correct stylesheet.
    >
    > Here is the publish part of the ACL. There was some package changes between the versions could it be something with the _pubpdf::run_distiller???:
    >
    > if ($allData)
    > {
    > set printstylesheet="AllData-fo.xsl";
    > $psname = "c:\\_epictemp\\" . $model . "_alldata.ps"
    > $pdfname = $outdir . $model . "_alldata.pdf"
    > print composed wait printer="$useprinter" file="$psname";
    > _pubpdf::run_distiller("$psname","$pdfname");
    > message "Published All Data Report"
    > $correct='1';
    > remove_file "$psname";
    > }
    >
    > Here is where it calls the Pagemaster:
    >
    > <xsl:template match="index">
    > <fo:page-sequence master-reference="PageMaster" initial-page-number="1">
    > ...
    > <fo:flow flow-name="xsl-region-body" margin-top="1.00in">
    > <fo:block-container>
    > <fo:table border-style="solid" border-color="black" border-width="1pt">
    > <fo:table-column column-width="0.50in"/">
    > <fo:table-column column-width="0.50in"/">
    > <fo:table-column column-width="0.75in"/">
    > <fo:table-column column-width="0.70in"/">
    > <fo:table-column column-width="2.25in"/">
    > <fo:table-column column-width="0.80in"/">
    > <fo:table-column column-width="0.75in"/">
    > <fo:table-column column-width="1.00in"/">
    > <fo:table-column column-width="1.00in"/">
    > <fo:table-column column-width="1.75in"/">
    > <fo:table-body>
    > <xsl:apply-templates select="./item">
    > <xsl:sort select="mpcnum"/">
    > </xsl:apply-templates>
    > </fo:table-body>
    > </fo:table>
    > </fo:block-container>
    >
    10-Marble
    December 12, 2011
    Publish to PDF using to the Direct to PDF method works, but turning the use Distiller on and setting the Adobe PDF printer it does not work.

    I can open the same file in Arbortext 5.3 M090 and with Distiller turned on and the Adobe PDF printer set, it works fine. MMMM!!! :-(! Arbortext 6.0 bug?
    1-Visitor
    December 12, 2011
    Yes, that sounds rather bug-ish. In fact, I just tried duplicating
    this in 6.0 F000 with a very simple XSL-FO style sheet built in Styler
    and my landscape page is upside-down, too (same thing happened after
    switching the style sheet to FOSI). Time to get PTC Support on the
    phone.

    On the other hand, this might also be a good time to look at moving to
    Direct PDF. If it can meet your requirements, you'd have one less
    moving part (Distiller) in the system. I haven't done any serious
    comparisons, myself, but I understand the reasons to stick with
    Distiller have decreased significantly over the last couple of
    versions, for many use cases.

    -Brandon 🙂


    On Mon, Dec 12, 2011 at 10:48 AM, Price, Sarah CTR
    <sarah.r.price@uscg.mil> wrote:
    > Publish to PDF using to the Direct to PDF method works, but turning the use Distiller on and setting the Adobe PDF printer it does not work.
    >
    > I can open the same file in Arbortext 5.3 M090 and with Distiller turned on and the Adobe PDF printer set, it works fine. MMMM!!! :-(! Arbortext 6.0 bug?
    >