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

PDF Generation Question

6 Answers 150 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nelson
Top achievements
Rank 1
Nelson asked on 21 Jun 2011, 07:06 PM
Hello,

After poking around in various Telerik APIs (specifically, WinForms and ASP.NET Ajax) I noticed there is a Telerik.PDF namespace. I'm not sure to what extent Telerik supports generation of PDF documents, but let me elaborate on my situation and hopefully someone can indicate whether Telerik controls can be used to find a resolution.

Essentially, on our website, we have web pages that replicate paper applications a user might fill out physically. We'd like to automate the process so that they can basically fill out a virtual application. A requirement of our customers, however, is that we need to generate a copy of the application, as they always had the original in the past. The first thought was to generate a PDF of the filled out 'virtual document' however this is proving to be extremely difficult due to the nature of generating a PDF from a web page in general. We do not require the PDF to replicate the controls on the web page, simply the layout; even if this is a flat image. In fact, a flat image may even be prefereable.

I noticed the RadGrid has export to PDF functionality built in. I am wondering if:

A) Has anyone generated PDFs from webpages? With Telerik?

- or -

B) Is there enough functionality in the Telerik.PDF namespace to engineer this solution myself if need be?

Lastly, if neither of these is true (which would be somewhat unfortunate) is a web PDF snapshot generator in the works at all?

Thanks,
Nelson

6 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 27 Jun 2011, 08:50 AM
Hello Nelson,

Telerik.PDF namespace is used internally for generating PDF files. Due to limitations in this code we do not provide support for it when used outside of our controls.
In fact, there is an easy way to export the desired custom HTML layout using an empty RadGrid.
Please refer to the attached example.

Regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
GK
Top achievements
Rank 1
answered on 12 Jul 2011, 11:49 AM
Hi Telerik Team,

Will you please help me out in these two following issues. I am using Telerik licenced version 2010.3.1109.20, with I.E 8.0
1. How to save directly to file by export to pdf feature of RadGrid, in a specified path. 
2. When I try to export my grid(which is having 15 columns) then it exports only first few columns, not all columns are exported to pdf,  so, how to export all my columns and rows(or complete grid data) into pdf and automatically save at specified path.


Thanks
Gopi Krishna

0
Daniel
Telerik team
answered on 18 Jul 2011, 06:36 AM
Hello Gopi,

Straight onto your questions:

1) Please check the attached demo. Note that you can save the file on the server, and not on the client.

2) I recommend that you examine the PDF export Q&A section in the help topic below:
PDF export

Regards,
Daniel
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
GK
Top achievements
Rank 1
answered on 22 Jul 2011, 03:53 PM
Hi Daniel,

Thanks for your reply, I could solve both the issues, but I could not justify the columns to right in pdf, below is my code which i am using.
protected void grdContribution_Prerender(object sender, EventArgs e)
    {
        foreach (GridColumn col in grdContribution.MasterTableView.Columns)
            {
                col.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
            }
    }
protected void RadGrid1_GridExporting(object source, GridExportingArgs e)
    {
            foreach (GridColumn col in grdContribution.MasterTableView.Columns)
            {
                col.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
            }
}


I have even given in aspx page and tried, but still in my pdf, the columns are left just justified and the header columns are right justified.

waiting for your early reply.

Thanks
Gopi Krishna

 

0
Daniel
Telerik team
answered on 22 Jul 2011, 04:14 PM
Hello Gopi,

You should use inline styles in order to change the text alignment. You can see this approach in action on our online demo:
Export to PDF

I hope this helps.

Best regards,
Daniel
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
GK
Top achievements
Rank 1
answered on 25 Jul 2011, 11:26 AM
Thanks Daniel, now I could able to right justify my columns in pdf.

Thanks
Gopi Krishna


Tags
General Discussions
Asked by
Nelson
Top achievements
Rank 1
Answers by
Daniel
Telerik team
GK
Top achievements
Rank 1
Share this question
or