Loading ...
Sorry, an error occurred while loading the content.

Question On Combing Two PDFs Into One

Expand Messages
  • Michael Duffy
    I m using Apache s FOP library to dynamically generate PDFs from an XML input stream using XSL-FO stylesheets. I ll refer to my first successful effort as the
    Message 1 of 5 , Jul 6, 2004
    • 0 Attachment
      I'm using Apache's FOP library to dynamically generate
      PDFs from an XML input stream using XSL-FO
      stylesheets.

      I'll refer to my first successful effort as the "data"
      page. This consisted of a number of pages with
      tabular data and a static header that was repeated on
      each page. I generated them using a single XSL-FO
      stylesheet and sent the byte stream to a browser for
      rendering in Adobe Reader.

      My client decided that I needed to add a single
      lead-in page that I'll call the "summary" page. It
      would obtain its data from the same XML input stream.

      I wrote a separate XSL-FO stylesheet to produce the
      "summary" page that alsos works very nicely.

      My problem comes when I try to combine these two into
      a single PDF document byte stream to send back to the
      browser.

      My best effort so far is a single XSL-FO stylesheet
      that uses two page masters. It produces the "summary"
      page, followed by as many "data" pages as needed, each
      with their own format.

      But now I can't add that static header to just the
      "data" pages. As far as I can see, I can either add
      the static "region-before" header to all the pages or
      none of them.

      Can anyone tell me how I can choose where the static
      header goes OR tell me how I might concatenate these
      two PDFs into a single stream?

      The iText library has a command line concat facility
      that depends on disk files. I'd like to accomplish
      this without resorting to disk read/write. Is it
      possible? Thanks - MOD




      __________________________________
      Do you Yahoo!?
      Yahoo! Mail - 50x more storage than other providers!
      http://promotions.yahoo.com/new_mail
    • Chris Bowditch
      Michael Duffy wrote: ... That is not the case. It usually straight forward to define different static content for different simple page masters. Post a
      Message 2 of 5 , Jul 12, 2004
      • 0 Attachment
        Michael Duffy wrote:

        <snip/>

        > But now I can't add that static header to just the
        > "data" pages. As far as I can see, I can either add
        > the static "region-before" header to all the pages or
        > none of them.

        That is not the case. It usually straight forward to define different static
        content for different simple page masters. Post a snippet of your XSL-Fo,
        namely the layout-master-set and we will attempt to advise you on whats wrong.

        >
        > Can anyone tell me how I can choose where the static
        > header goes OR tell me how I might concatenate these
        > two PDFs into a single stream?
        >
        > The iText library has a command line concat facility
        > that depends on disk files. I'd like to accomplish
        > this without resorting to disk read/write. Is it
        > possible? Thanks - MOD

        I have used iText before, and found it very useful. I believe it is quite good
        a concatenating PDFs, but in your case I dont think it is necessary.

        Chris
      • duffymo
        Hi Chris, Turns out that you re correct. I have managed to add different page masters. The additional bit that I had to figure out what having a named
        Message 3 of 5 , Jul 12, 2004
        • 0 Attachment
          Hi Chris,

          Turns out that you're correct. I have managed to add different page
          masters.

          The additional bit that I had to figure out what having a named
          template with a parameter so I could process the XML input tag in
          different ways depending on which page I was on. I also had to add
          <xsl:with-param> to the <xsl:apply-templates> for each page to drive
          the right behavior.

          That's working VERY nicely now. I have a stray blank page thrown in
          after the first one that's mystifying me a bit, but the rest look
          just the way I want. No need for iText now. Thanks - MOD


          --- In XSL-FO@yahoogroups.com, Chris Bowditch <bowditch_chris@h...>
          wrote:
          > Michael Duffy wrote:
          >
          > <snip/>
          >
          > > But now I can't add that static header to just the
          > > "data" pages. As far as I can see, I can either add
          > > the static "region-before" header to all the pages or
          > > none of them.
          >
          > That is not the case. It usually straight forward to define
          different static
          > content for different simple page masters. Post a snippet of your
          XSL-Fo,
          > namely the layout-master-set and we will attempt to advise you on
          whats wrong.
          >
          > >
          > > Can anyone tell me how I can choose where the static
          > > header goes OR tell me how I might concatenate these
          > > two PDFs into a single stream?
          > >
          > > The iText library has a command line concat facility
          > > that depends on disk files. I'd like to accomplish
          > > this without resorting to disk read/write. Is it
          > > possible? Thanks - MOD
          >
          > I have used iText before, and found it very useful. I believe it is
          quite good
          > a concatenating PDFs, but in your case I dont think it is necessary.
          >
          > Chris
        • duffymo
          Hi Chris, Should I post my Why extra blank page? as a separate thread, or can we continue the discussion in this one? MOD ... page ... drive ... in ... is
          Message 4 of 5 , Jul 12, 2004
          • 0 Attachment
            Hi Chris,

            Should I post my "Why extra blank page?" as a separate thread, or can
            we continue the discussion in this one?

            MOD


            --- In XSL-FO@yahoogroups.com, "duffymo" <duffymo@y...> wrote:
            > Hi Chris,
            >
            > Turns out that you're correct. I have managed to add different
            page
            > masters.
            >
            > The additional bit that I had to figure out what having a named
            > template with a parameter so I could process the XML input tag in
            > different ways depending on which page I was on. I also had to add
            > <xsl:with-param> to the <xsl:apply-templates> for each page to
            drive
            > the right behavior.
            >
            > That's working VERY nicely now. I have a stray blank page thrown
            in
            > after the first one that's mystifying me a bit, but the rest look
            > just the way I want. No need for iText now. Thanks - MOD
            >
            >
            > --- In XSL-FO@yahoogroups.com, Chris Bowditch <bowditch_chris@h...>
            > wrote:
            > > Michael Duffy wrote:
            > >
            > > <snip/>
            > >
            > > > But now I can't add that static header to just the
            > > > "data" pages. As far as I can see, I can either add
            > > > the static "region-before" header to all the pages or
            > > > none of them.
            > >
            > > That is not the case. It usually straight forward to define
            > different static
            > > content for different simple page masters. Post a snippet of your
            > XSL-Fo,
            > > namely the layout-master-set and we will attempt to advise you on
            > whats wrong.
            > >
            > > >
            > > > Can anyone tell me how I can choose where the static
            > > > header goes OR tell me how I might concatenate these
            > > > two PDFs into a single stream?
            > > >
            > > > The iText library has a command line concat facility
            > > > that depends on disk files. I'd like to accomplish
            > > > this without resorting to disk read/write. Is it
            > > > possible? Thanks - MOD
            > >
            > > I have used iText before, and found it very useful. I believe it
            is
            > quite good
            > > a concatenating PDFs, but in your case I dont think it is
            necessary.
            > >
            > > Chris
          • duffymo
            Hi Chris, Sorry for the bother. I found the answer to my extra blank page problem here: http://xml.apache.org/fop/faq.html#blank-page-between-page-sequences
            Message 5 of 5 , Jul 12, 2004
            • 0 Attachment
              Hi Chris,

              Sorry for the bother. I found the answer to my "extra blank page"
              problem here:

              http://xml.apache.org/fop/faq.html#blank-page-between-page-sequences

              MOD


              --- In XSL-FO@yahoogroups.com, "duffymo" <duffymo@y...> wrote:
              >
              > Hi Chris,
              >
              > Should I post my "Why extra blank page?" as a separate thread, or
              can
              > we continue the discussion in this one?
              >
              > MOD
              >
              >
              > --- In XSL-FO@yahoogroups.com, "duffymo" <duffymo@y...> wrote:
              > > Hi Chris,
              > >
              > > Turns out that you're correct. I have managed to add different
              > page
              > > masters.
              > >
              > > The additional bit that I had to figure out what having a named
              > > template with a parameter so I could process the XML input tag in
              > > different ways depending on which page I was on. I also had to
              add
              > > <xsl:with-param> to the <xsl:apply-templates> for each page to
              > drive
              > > the right behavior.
              > >
              > > That's working VERY nicely now. I have a stray blank page thrown
              > in
              > > after the first one that's mystifying me a bit, but the rest look
              > > just the way I want. No need for iText now. Thanks - MOD
              > >
              > >
              > > --- In XSL-FO@yahoogroups.com, Chris Bowditch
              <bowditch_chris@h...>
              > > wrote:
              > > > Michael Duffy wrote:
              > > >
              > > > <snip/>
              > > >
              > > > > But now I can't add that static header to just the
              > > > > "data" pages. As far as I can see, I can either add
              > > > > the static "region-before" header to all the pages or
              > > > > none of them.
              > > >
              > > > That is not the case. It usually straight forward to define
              > > different static
              > > > content for different simple page masters. Post a snippet of
              your
              > > XSL-Fo,
              > > > namely the layout-master-set and we will attempt to advise you
              on
              > > whats wrong.
              > > >
              > > > >
              > > > > Can anyone tell me how I can choose where the static
              > > > > header goes OR tell me how I might concatenate these
              > > > > two PDFs into a single stream?
              > > > >
              > > > > The iText library has a command line concat facility
              > > > > that depends on disk files. I'd like to accomplish
              > > > > this without resorting to disk read/write. Is it
              > > > > possible? Thanks - MOD
              > > >
              > > > I have used iText before, and found it very useful. I believe
              it
              > is
              > > quite good
              > > > a concatenating PDFs, but in your case I dont think it is
              > necessary.
              > > >
              > > > Chris
            Your message has been successfully submitted and would be delivered to recipients shortly.