Sign In  Sign Up Live-Chat

PDF PageBorder.Bottom

Last post 08-15-2008, 8:15 AM by IrishTek. 6 replies.
Sort Posts: Previous Next
  •  08-07-2008, 2:26 PM 138816

    PDF PageBorder.Bottom

    How can I create text in the bottom page border such that it shows up on every page.

    For example, I want my pdf file to say "Prepared by Irish Tek" centered at the bottom of each page.

     

    Thank you

     

    Tek

     
  •  08-07-2008, 3:23 PM 138837 in reply to 138816

    Re: PDF PageBorder.Bottom

    Hi,

    Thanks for considering Aspose.

    As far I have understood from you requirement, you want to add the footer section on every page of Pdf. For information in adding Footer section please visit Set Page Header and Footer


    Nayyer Shahbaz
    Support Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  08-08-2008, 7:23 AM 138941 in reply to 138837

    Re: PDF PageBorder.Bottom

    thank you
     
  •  08-11-2008, 9:44 AM 139208 in reply to 138837

    Re: PDF PageBorder.Bottom

    I tested this out using the C# example from the weblink:

    [C#]

     

    //Instantiate HeaderFooter object and pass the Section reference in which

    //the header or footer is to be added

    HeaderFooter hf1 = new HeaderFooter(sec1);

     

    //Set the header of odd pages of the PDF document

    sec1.OddHeader = hf1;

     

    //Set the header of even pages of the PDF document

    sec1.EvenHeader = hf1;

     

    //Instantiate a Text paragraph that will store the content to show as header

    Text text = new Text(hf1,"header");

     

    //Add the text object to the Paragraphs collection of HeaderFooter object to

    //display header on the pages of PDF document

    hf1.Paragraphs.Add(text);

     

     

    And then after the last line I tried the following:

    pdf.BindHTML(stream_reader);

     

     

    What I was hoping for was to have the header text to show up on every page.  However, what I am getting is a blank page with the header text and the subsequent pages has the information from the stream_reader but they do not have any header text.

     

    Is there a way to bind to html and still have the header/footer functionality work?

     
  •  08-12-2008, 2:58 AM 139318 in reply to 139208

    Re: PDF PageBorder.Bottom

    Hi,

     

    HTML to Pdf conversion is in beta version. It lacks few of the features that are offered in other conversion scenarios. Adding header/footer while conversion from HTML to Pdf is not yet supported. We would try to implement it in our future versions, but I am afraid we cannot support it in short time. Sorry for this inconvenience.


    Nayyer Shahbaz
    Support Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  08-14-2008, 10:25 AM 139772 in reply to 139318

    Re: PDF PageBorder.Bottom

    Hi,

    I think you can achieve it by adding the custome header/footer to every section of the pdf object. Please try the following sample code:
    [C#]
    //Bind the html stream to pdf object
    pdf.BindHTML(stream_reader);
    //add customed header to every section of the pdf object         
    foreach (Section sec1 in pdf.Sections)
    {
        HeaderFooter hf1 = new HeaderFooter(sec1);
        //Set the header of odd pages of the PDF document
        sec1.OddHeader = hf1;
        //Set the header of even pages of the PDF document
        sec1.EvenHeader = hf1;
        //Instantiate a Text paragraph that will store the content to show as header
        Text text = new Text(hf1, "header");
        //Add the text object to the Paragraphs collection of HeaderFooter object to
        //display header on the pages of PDF document
        text.TextInfo.Alignment = AlignmentType.Center;
        hf1.Paragraphs.Add(text);
    }
    //Save the pdf
    pdf.Save(@"F:/temp/test.pdf");
    Please give it a try and feel free to let us know if you have any other problem.
    Thanks.

    Best regards.


    Hans Zhang
    Product Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  08-15-2008, 8:15 AM 139889 in reply to 139772

    Re: PDF PageBorder.Bottom

    yes, this worked - thank you.
     
View as RSS news feed in XML