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

Get number of pages in PDF file

Expand Messages
  • Torben C G Jensen
    When I have generated the PDF file, I want to know how many page there was generated. I haven t been able to find any methods that can give me this
    Message 1 of 8 , Nov 7, 2002
    • 0 Attachment
      When I have generated the PDF file, I want to know how many page there was generated.

      I haven't been able to find any methods that can give me this information, so my idea is to change the render(XMLReader parser, InputSource source) method in the Driver class, so that it returns streamRenderer.pageCount - which is the the number of pages that were generated.

      It is the only way or have I missed something?

      Please let me know if you have other suggestions.

      /Torben


      [Non-text portions of this message have been removed]
    • David A. Sisk
      The way I accomplish this is import the PDF into iText and query it that way. Also allows me to set doc properties as well as encryption. ...
      Message 2 of 8 , Nov 7, 2002
      • 0 Attachment
        The way I accomplish this is import the PDF into
        iText and query it that way. Also allows me to set doc
        properties as well as encryption.



        --- Torben C G Jensen <tj@...> wrote:
        > When I have generated the PDF file, I want to know
        > how many page there was generated.
        >
        > I haven't been able to find any methods that can
        > give me this information, so my idea is to change
        > the render(XMLReader parser, InputSource source)
        > method in the Driver class, so that it returns
        > streamRenderer.pageCount - which is the the number
        > of pages that were generated.
        >
        > It is the only way or have I missed something?
        >
        > Please let me know if you have other suggestions.
        >
        > /Torben
        >
        >
        > [Non-text portions of this message have been
        > removed]
        >
        >
        > To unsubscribe from this group, send an email to:
        > XSL-FO-unsubscribe@egroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >


        __________________________________________________
        Do you Yahoo!?
        U2 on LAUNCH - Exclusive greatest hits videos
        http://launch.yahoo.com/u2
      • Oleg Tkachenko
        ... Which formatter are you using? API you meant looks familiar to me, so I presume you are about FOP. If so, you can ask Driver object when formatting is done
        Message 3 of 8 , Nov 7, 2002
        • 0 Attachment
          Torben C G Jensen wrote:

          > When I have generated the PDF file, I want to know how many page there was
          > generated.
          >
          > I haven't been able to find any methods that can give me this information,
          > so my idea is to change the render(XMLReader parser, InputSource source)
          > method in the Driver class, so that it returns streamRenderer.pageCount -
          > which is the the number of pages that were generated.
          >
          > It is the only way or have I missed something?

          Which formatter are you using?
          API you meant looks familiar to me, so I presume you are about FOP.
          If so, you can ask Driver object when formatting is done how much pages were
          generated:

          driver.getResults().getPageCount();

          --
          Oleg Tkachenko
          eXperanto team
          Multiconn Technologies, Israel
        • Torben C G Jensen
          That is not an option - doing something manually like starting iText etc is not an option - I need to be able to get the total page number directly - since I
          Message 4 of 8 , Nov 7, 2002
          • 0 Attachment
            That is not an option - doing something manually like starting iText etc is not an option - I need to be able to get the total page number directly - since I am processing alot of PDFs.

            /Torben
            ----- Original Message -----
            From: David A. Sisk
            To: XSL-FO@yahoogroups.com
            Sent: Thursday, November 07, 2002 3:57 PM
            Subject: Re: [XSL-FO] Get number of pages in PDF file



            The way I accomplish this is import the PDF into
            iText and query it that way. Also allows me to set doc
            properties as well as encryption.



            --- Torben C G Jensen <tj@...> wrote:
            > When I have generated the PDF file, I want to know
            > how many page there was generated.
            >
            > I haven't been able to find any methods that can
            > give me this information, so my idea is to change
            > the render(XMLReader parser, InputSource source)
            > method in the Driver class, so that it returns
            > streamRenderer.pageCount - which is the the number
            > of pages that were generated.
            >
            > It is the only way or have I missed something?
            >
            > Please let me know if you have other suggestions.
            >
            > /Torben
            >
            >
            > [Non-text portions of this message have been
            > removed]
            >
            >
            > To unsubscribe from this group, send an email to:
            > XSL-FO-unsubscribe@egroups.com
            >
            >
            >
            > Your use of Yahoo! Groups is subject to
            > http://docs.yahoo.com/info/terms/
            >
            >


            __________________________________________________
            Do you Yahoo!?
            U2 on LAUNCH - Exclusive greatest hits videos
            http://launch.yahoo.com/u2

            To unsubscribe from this group, send an email to:
            XSL-FO-unsubscribe@egroups.com



            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



            [Non-text portions of this message have been removed]
          • David A. Sisk
            Not sure what you mean by starting iText manually. PdfReader reader = new PdfReader(byteArray); return reader.getNumberOfPages(); That s about it. ...
            Message 5 of 8 , Nov 7, 2002
            • 0 Attachment
              Not sure what you mean by starting iText manually.

              PdfReader reader = new PdfReader(byteArray);
              return reader.getNumberOfPages();

              That's about it.

              --- Torben C G Jensen <tj@...> wrote:
              > That is not an option - doing something manually
              > like starting iText etc is not an option - I need to
              > be able to get the total page number directly -
              > since I am processing alot of PDFs.
              >
              > /Torben
              > ----- Original Message -----
              > From: David A. Sisk
              > To: XSL-FO@yahoogroups.com
              > Sent: Thursday, November 07, 2002 3:57 PM
              > Subject: Re: [XSL-FO] Get number of pages in PDF
              > file
              >
              >
              >
              > The way I accomplish this is import the PDF into
              > iText and query it that way. Also allows me to set
              > doc
              > properties as well as encryption.
              >
              >
              >
              > --- Torben C G Jensen <tj@...> wrote:
              > > When I have generated the PDF file, I want to
              > know
              > > how many page there was generated.
              > >
              > > I haven't been able to find any methods that can
              > > give me this information, so my idea is to
              > change
              > > the render(XMLReader parser, InputSource source)
              > > method in the Driver class, so that it returns
              > > streamRenderer.pageCount - which is the the
              > number
              > > of pages that were generated.
              > >
              > > It is the only way or have I missed something?
              > >
              > > Please let me know if you have other
              > suggestions.
              > >
              > > /Torben
              > >
              > >
              > > [Non-text portions of this message have been
              > > removed]
              > >
              > >
              > > To unsubscribe from this group, send an email
              > to:
              > > XSL-FO-unsubscribe@egroups.com
              > >
              > >
              > >
              > > Your use of Yahoo! Groups is subject to
              > > http://docs.yahoo.com/info/terms/
              > >
              > >
              >
              >
              > __________________________________________________
              > Do you Yahoo!?
              > U2 on LAUNCH - Exclusive greatest hits videos
              > http://launch.yahoo.com/u2
              >
              > To unsubscribe from this group, send an email to:
              > XSL-FO-unsubscribe@egroups.com
              >
              >
              >
              > Your use of Yahoo! Groups is subject to the Yahoo!
              > Terms of Service.
              >
              >
              >
              > [Non-text portions of this message have been
              > removed]
              >
              >
              > To unsubscribe from this group, send an email to:
              > XSL-FO-unsubscribe@egroups.com
              >
              >
              >
              > Your use of Yahoo! Groups is subject to
              > http://docs.yahoo.com/info/terms/
              >
              >


              __________________________________________________
              Do you Yahoo!?
              U2 on LAUNCH - Exclusive greatest hits videos
              http://launch.yahoo.com/u2
            • Torben C G Jensen
              ok - sorry. I don t know anything about iText. I just assumed that you would have to start it separately. ... From: David A. Sisk To: XSL-FO@yahoogroups.com
              Message 6 of 8 , Nov 7, 2002
              • 0 Attachment
                ok - sorry. I don't know anything about iText. I just assumed that you would have to start it separately.

                ---- Original Message -----
                From: David A. Sisk
                To: XSL-FO@yahoogroups.com
                Sent: Thursday, November 07, 2002 4:48 PM
                Subject: Re: [XSL-FO] Get number of pages in PDF file



                Not sure what you mean by starting iText manually.

                PdfReader reader = new PdfReader(byteArray);
                return reader.getNumberOfPages();

                That's about it.

                --- Torben C G Jensen <tj@...> wrote:
                > That is not an option - doing something manually
                > like starting iText etc is not an option - I need to
                > be able to get the total page number directly -
                > since I am processing alot of PDFs.
                >
                > /Torben
                > ----- Original Message -----
                > From: David A. Sisk
                > To: XSL-FO@yahoogroups.com
                > Sent: Thursday, November 07, 2002 3:57 PM
                > Subject: Re: [XSL-FO] Get number of pages in PDF
                > file
                >
                >
                >
                > The way I accomplish this is import the PDF into
                > iText and query it that way. Also allows me to set
                > doc
                > properties as well as encryption.
                >
                >
                >
                > --- Torben C G Jensen <tj@...> wrote:
                > > When I have generated the PDF file, I want to
                > know
                > > how many page there was generated.
                > >
                > > I haven't been able to find any methods that can
                > > give me this information, so my idea is to
                > change
                > > the render(XMLReader parser, InputSource source)
                > > method in the Driver class, so that it returns
                > > streamRenderer.pageCount - which is the the
                > number
                > > of pages that were generated.
                > >
                > > It is the only way or have I missed something?
                > >
                > > Please let me know if you have other
                > suggestions.
                > >
                > > /Torben
                > >
                > >
                > > [Non-text portions of this message have been
                > > removed]
                > >
                > >
                > > To unsubscribe from this group, send an email
                > to:
                > > XSL-FO-unsubscribe@egroups.com
                > >
                > >
                > >
                > > Your use of Yahoo! Groups is subject to
                > > http://docs.yahoo.com/info/terms/
                > >
                > >
                >
                >
                > __________________________________________________
                > Do you Yahoo!?
                > U2 on LAUNCH - Exclusive greatest hits videos
                > http://launch.yahoo.com/u2
                >
                > To unsubscribe from this group, send an email to:
                > XSL-FO-unsubscribe@egroups.com
                >
                >
                >
                > Your use of Yahoo! Groups is subject to the Yahoo!
                > Terms of Service.
                >
                >
                >
                > [Non-text portions of this message have been
                > removed]
                >
                >
                > To unsubscribe from this group, send an email to:
                > XSL-FO-unsubscribe@egroups.com
                >
                >
                >
                > Your use of Yahoo! Groups is subject to
                > http://docs.yahoo.com/info/terms/
                >
                >


                __________________________________________________
                Do you Yahoo!?
                U2 on LAUNCH - Exclusive greatest hits videos
                http://launch.yahoo.com/u2

                To unsubscribe from this group, send an email to:
                XSL-FO-unsubscribe@egroups.com



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



                [Non-text portions of this message have been removed]
              • Torben C G Jensen
                yes I am using FOP. But it is not the newest version - I am using version 0.20.1 (I believe it is called). I don t have a getResults() on the Driver class. So
                Message 7 of 8 , Nov 7, 2002
                • 0 Attachment
                  yes I am using FOP. But it is not the newest version - I am using version 0.20.1 (I believe it is called).
                  I don't have a getResults() on the Driver class. So you must be using a newer version.


                  ----- Original Message -----
                  From: Oleg Tkachenko
                  To: XSL-FO@yahoogroups.com
                  Sent: Thursday, November 07, 2002 4:35 PM
                  Subject: Re: [XSL-FO] Get number of pages in PDF file


                  Torben C G Jensen wrote:

                  > When I have generated the PDF file, I want to know how many page there was
                  > generated.
                  >
                  > I haven't been able to find any methods that can give me this information,
                  > so my idea is to change the render(XMLReader parser, InputSource source)
                  > method in the Driver class, so that it returns streamRenderer.pageCount -
                  > which is the the number of pages that were generated.
                  >
                  > It is the only way or have I missed something?

                  Which formatter are you using?
                  API you meant looks familiar to me, so I presume you are about FOP.
                  If so, you can ask Driver object when formatting is done how much pages were
                  generated:

                  driver.getResults().getPageCount();

                  --
                  Oleg Tkachenko
                  eXperanto team
                  Multiconn Technologies, Israel


                  To unsubscribe from this group, send an email to:
                  XSL-FO-unsubscribe@egroups.com



                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



                  [Non-text portions of this message have been removed]
                • Oleg Tkachenko
                  ... If so, consider upgrading up to the latest version, which is 0.20.4 (and 0.20.5 is a matter of weeks), it s much advanced, compared to more than 1 year old
                  Message 8 of 8 , Nov 8, 2002
                  • 0 Attachment
                    Torben C G Jensen wrote:
                    > yes I am using FOP. But it is not the newest version - I am using version 0.20.1 (I believe it is called).
                    > I don't have a getResults() on the Driver class. So you must be using a newer version.
                    If so, consider upgrading up to the latest version, which is 0.20.4 (and
                    0.20.5 is a matter of weeks), it's much advanced, compared to more than
                    1 year old 0.20.1.

                    --
                    Oleg Tkachenko
                    eXperanto team
                    Multiconn Technologies, Israel
                  Your message has been successfully submitted and would be delivered to recipients shortly.