Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7195345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:33:39+00:00 2026-05-28T20:33:39+00:00

I dont know if what I am trying to do is even possible, and

  • 0

I dont know if what I am trying to do is even possible, and it might be too much work for something very insignificant. I have a servlet that creates a PDF. I am using iText to write to the created pdf, in my pdf I have a dynamic table that can change the size of the document. I would like to print “Continued on next page” at the bottom of the document whenever it needs to go to the next page. The problem is I will never know where the page break occurs in my document.

I am more than happy to add code to this, if this is possible. Also, if this isnt clear, feel free to ask questions, thanks.

EDIT: Probably talking to myself, but The only way that I think this is possible is if there is a method that realizes that a new page has just been created.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:33:40+00:00Added an answer on May 28, 2026 at 8:33 pm

    You can try to apply this snippet in your pdf generator class:

    private static final float FOOTER_MARGIN = 15;
    private static final float PAGE_MARGIN_LEFT = 36;
    private static final float PAGE_MARGIN_RIGHT = 36;
    private static final float PAGE_MARGIN_BOTTOM = 36 + FOOTER_MARGIN;
    private static final float PAGE_MARGIN_TOP = 36;
    private static final Rectangle PAGE_SIZE = PageSize.A4;
    
    //Put this in your generator method
    //..
    Document document = new Document(PAGE_SIZE, 
             PAGE_MARGIN_LEFT, PAGE_MARGIN_RIGHT, PAGE_MARGIN_BOTTOM, MARGIN_TOP); 
    PdfWriter writer = PdfWriter.getInstance(document, OUTPUT_STREAM); 
    writer.setPageEvent(new HeaderFooter()); 
    //..
    
    private class HeaderFooter extends PdfPageEventHelper {
    
        @Override
        public void onEndPage(PdfWriter writer, Document document) {
            Phrase footerText = new Phrase("Continued On Next Page");
            ColumnText.showTextAligned(
                    writer.getDirectContent(),
                    Element.ALIGN_LEFT, footerText,
                    PAGE_MARGIN_LEFT, PAGE_MARGIN_BOTTOM - FOOTER_MARGIN, 0);
        }
    }
    

    FYI, there are bunch of iText examples, in your case search for footer. Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to achieve something but i dont really know how I have set
I am trying to do something I don't know if it's doable. I have
I am trying to create my own torrent tracker but dont know how to
i am trying to get some data, but i dont know how can i
I'm trying to learn EF using code first, i dont know how to design
I am trying to create a composite key for MYSQL, but i dont know
Trying to develop using MVVM: I have this Csla.PropertyStatus control that is created in
I'm trying to figure out if this is even possible: I'm interested in writing
I'm trying to have a user-defined list of game-maps. Because I don't know how
i am trying to overwrite the NSURLConnection Delegate but i dont know where to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.