I've been working in the background on a patch that adds support for using
newer PDF features, including page transitions and option groups, and in
this work defined an new element in the FOP CONF file as follows to specify
the PDF output version:

<?xml version="1.0"?>
<fop version="1.0">
  <source-resolution>300</source-resolution>
  <target-resolution>300</target-resolution>
  <base14-kerning>true</base14-kerning>
  <renderers>
    <renderer mime="application/pdf">
*      <pdf-version>1.5</pdf-version>*
      <filterList>
<value>flate</value>
      </filterList>
      <fonts>
 <auto-detect/>
      </fonts>
    </renderer>
    <renderer mime="text/xml">
      <fonts>
 <base14-kerning>true</base14-kerning>
      </fonts>
    </renderer>
  </renderers>
</fop>

Here is an example of the extensions I used to specify a page transition:

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple" page-height="3in"
page-width="5in" margin-top="1cm" margin-bottom="1cm" margin-left="1cm"
margin-right="1cm">
      <fo:region-body margin-top="1cm"/>
      <fo:region-before extent="1cm"/>
      <fo:region-after extent="1cm"/>
*      <pdf:page page-numbers="*" xmlns:pdf="
http://xmlgraphics.apache.org/fop/extensions/pdf";>*
*        <pdf:number key="Dur">5</pdf:number>*
*      </pdf:page>*
*      <pdf:page page-numbers="1" xmlns:pdf="
http://xmlgraphics.apache.org/fop/extensions/pdf";>*
* **<pdf:dictionary key="Trans">*
*          <pdf:name key="Type">Trans</pdf:name>*
*          <pdf:number key="D">1</pdf:number>*
*          <pdf:name key="S">Glitter</pdf:name>*
*          <pdf:number key="Di">0</pdf:number>*
* **</pdf:dictionary>*
*      </pdf:page>*
*      <pdf:page page-numbers="2" xmlns:pdf="
http://xmlgraphics.apache.org/fop/extensions/pdf";>*
* **<pdf:dictionary key="Trans">*
*          <pdf:name key="Type">Trans</pdf:name>*
*          <pdf:number key="D">1</pdf:number>*
*          <pdf:name key="S">Push</pdf:name>*
*          <pdf:number key="Di">180</pdf:number>*
* **</pdf:dictionary>*
*      </pdf:page>*
*      <pdf:page page-numbers="3" xmlns:pdf="
http://xmlgraphics.apache.org/fop/extensions/pdf";>*
* **<pdf:dictionary key="Trans">*
*          <pdf:name key="Type">Trans</pdf:name>*
*          <pdf:number key="D">1</pdf:number>*
*          <pdf:name key="S">Cover</pdf:name>*
*          <pdf:number key="Di">270</pdf:number>*
* **</pdf:dictionary>*
*      </pdf:page>*
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simple">
    <fo:flow flow-name="xsl-region-body">
    ... 3 pages of content...
    </fo:flow>
  </fo:page-sequence>
</fo:root>

Basically I use the above to explicitly extend the PDF Page dictionary for
indicated pages. I based this work in part on an earlier patch (not yet
integrated) that took a similar approach to extending the generated
dictionaries.

I'll try to post a patch for this work in a few days in case someone is
interested in trying it out.

Glenn

On Mon, Mar 14, 2011 at 8:12 AM, Eric Douglas <[email protected]>wrote:

> PDF readers should be backward compatible.
> AFAIK there's no reason to write a newer version number unless a newer
> version adds a feature you need.
>
>
> -----Original Message-----
> From: mehdi houshmand [mailto:[email protected]]
> Sent: Monday, March 14, 2011 10:10 AM
> To: [email protected]
> Subject: Re: PDF version specification
>
> Hi Markus,
>
> Unfortunately looking at the code, the PDF version (1.4) is hard-coded.
> This is presumably because FOP doesn't support any of the features of
> subsequent versions, though I'm sure someone in the community will be
> able to tell you the exact reasons for this.
>
> You may be able to change this to 1.6, but either someone else in the
> community will be able to help you out there, or I'd suggest looking at
> the PDF spec, if PDF is backward compatible you can change the version
> with impunity. The PDF version is set in o.a.f.pdf.PDFDocument line 103.
> You'll probably have to do something to PDFProfile and add an extra case
> in PDFDocument.getPDFVersionString(). But that shouldn't be too
> difficult, that is of-course if there aren't any calamitous affects to
> do with the PDF spec, which I sadly lack knowledge in.
>
> Hope that helps,
>
> Mehdi
>
> On 14 March 2011 13:46, Markus Ruggiero <[email protected]>
> wrote:
> > When I generate a simple PDF from within my Java app the resulting PDF
> file says PDF Version 1.4. My customer talks about going to PDF version
> 1.6 or higher. Is this something I have to explicitly set? Where would I
> do this? My tests are based on FOP 1.0 and the simple embedding examples
> from the xmlgraphics website.
> >
> > Thanks for any enlightening
> > ---markus---
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to