This is a migrated thread and some comments may be shown as answers.

PDF Processing

5 Answers 655 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
Naveen
Top achievements
Rank 1
Naveen asked on 01 Aug 2019, 08:22 PM
I am trying to create a PDF document and i want to setup a header and a footer, this should be the same for all the page. and then i want to insert data from stored procedure into this pdf file and format it. i have attached a template along with this. It will be very helpful if you can give me some suggestions.

5 Answers, 1 is accepted

Sort by
0
Naveen
Top achievements
Rank 1
answered on 01 Aug 2019, 08:26 PM
I am using asp.net (VB.Net) to develop this application that i am working on and i want to generate PDF's from the output of the stored procedure,.
0
Accepted
Martin
Telerik team
answered on 05 Aug 2019, 03:36 PM
Hello Naveen,

You can achieve this by drawing the headers and footers with FixedContentEditor instances for each page after all pages are created.

public static RadFixedDocument CreateDocumentWithHeadersAndFooters()
{
    RadFixedDocument document = new RadFixedDocument();
    using (RadFixedDocumentEditor documentEditor = new RadFixedDocumentEditor(document))
    {
        GenerateDocumentContentWithoutHeadersAndFooters(documentEditor);
    }
 
    int numberOfPages = document.Pages.Count;
 
    for (int pageIndex = 0; pageIndex < numberOfPages; pageIndex++)
    {
        int pageNumber = pageIndex + 1;
        FixedContentEditor pageEditor = new FixedContentEditor(document.Pages[pageIndex]);
        DrawHeaderAndFooter(pageEditor, pageNumber, numberOfPages);
    }
 
    return document;
}

We have a feature request to provide an API for easily drawing such content: Implement headers and footers in RadFixedDocumentEditor, which you can subscribe to by clicking the Follow button and vote for its implementation to increase the priority of the task.

Hope this is helpful.

Regards,
Martin
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Gary
Top achievements
Rank 1
commented on 07 Aug 2023, 03:07 PM

Using the fixed content editor effectively removes fillable form data and signatures. Is there another way to avoid this issue for fillable forms?
Martin
Telerik team
commented on 09 Aug 2023, 05:03 AM

Hi Gary,

Removing the signatures after editing a signed document is the expected behavior and I am afraid the only option is to sign it again after you finish the editing.

As for removing fillable form data, it is not expected and I have had no success with reproducing it on my side. Could I ask you to send us a sample project or detailed steps of how this behavior can be reproducible?

0
Naveen
Top achievements
Rank 1
answered on 15 Aug 2019, 09:54 PM

Hi Martin,

That was very helpful.

0
Zorica
Top achievements
Rank 1
answered on 24 Oct 2020, 06:07 PM
Any code for DrawHeaderAndFooter?
0
Dimitar
Telerik team
answered on 26 Oct 2020, 10:51 AM

Hello Zorica,

In this method, you can use the API of the FixedContentEditor to draw various elements on the page. An example of this is available in our SDK repository as well: document-processing-sdk/PdfProcessing/DrawHeaderFooter at master ยท telerik/document-processing-sdk

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
PdfProcessing
Asked by
Naveen
Top achievements
Rank 1
Answers by
Naveen
Top achievements
Rank 1
Martin
Telerik team
Zorica
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or