
I am using the script I found in another thread to export my reports directly to PDF. It is simple and works great. However, the size of the resulting PDFs seems too large. A single letter size page with one small logo and just text exports to 1.6 MB. If there a setting or something I can play with to help render these to a smaller file size?
Thanks
John
PS - I tried the same report without the logo and it only reduced the size by 0.1 MB.
9 Answers, 1 is accepted
Thank you for contacting Telerik Support.
The large size of your PDF file is most probably such because fonts are embedded in the file.
With Q3 2007 SP1 we introduced a configuration parameter for the PDF Rendering Extension called FontEmbedding. You can select whether to embed all fonts entirely (Full), embed only the used subsets (Subset) or do not embed fonts at all (None).
To learn how to configure you export to PDF with the settings that you want, please read carefully the following help topics:
Configuring Telerik Reporting
Device Information Settings
Note: In those topics, in places where version 2.0.0.0 is mentioned, you should put 2.0.1.0 if you are using the Service Pack.
If you have any problems configuring Telerik Reporting, do not hesitate to drop us a line.
All the best,
Ross
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Here is the code I am using;
Sub
ExportToPDF(ByVal reportName As String, ByVal reportToExport As Telerik.Reporting.Report)
Dim mimeType As String = String.Empty
Dim ext As String = String.Empty
Dim encoding As Encoding = Encoding.[Default]
Dim reportBytes As Byte() = ReportProcessor.Render("PDF", reportToExport, Nothing, mimeType, ext, encoding)
Dim fileName As String = reportName + ".pdf"
Response.Clear()
Response.ContentType = mimeType
Response.Cache.SetCacheability(HttpCacheability.[Private])
Response.Expires = -1
Response.Buffer =
False
Response.AddHeader("Content-Disposition", String.Format("{0};FileName=""{1}""", "attachment", fileName))
Response.OutputStream.Write(reportBytes, 0, reportBytes.Length)
Response.[End]()
End Sub
Where would I use the parameter you are talking about?
John
Instead of passing Nothing for the deviceInfo parameter of ReportProcessor.Render, you should create a new Hashtable and set the key "FontEmbedding" to "Subset' or "None".
...
Dim deviceInfo As Hashtable = new Hashtable()
deviceInfo("FontEmbedding") = "Subset"
Dim reportBytes As Byte() = ReportProcessor.Render("PDF", reportToExport, deviceInfo, mimeType, ext, encoding)
...
Best wishes,
Ross
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

The behavior that you are describing is very strange. Can we have the report that causes it. We would like to debug the PDF generation and locate the cause for this behavior.
Sincerely yours,
Ross
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

I have also used same code for generating PDF, I don't want to show PDF directly to User it will be sent through E-mail to the User. Can it's possible??
Thanks
We've already answered your question in the other forum thread you've opened. Please restrain from opening multiple threads with the same content as this only slows us down. A solution for emailing the report is available in this code library.
Best wishes,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Dim deviceInfo As Hashtable = new Hashtable()
deviceInfo("FontEmbedding") = "Subset"
Dim reportBytes As Byte() = ReportProcessor.Render("PDF", reportToExport, deviceInfo, mimeType, ext, encoding)
Thanks,
Vince
You can use our code converter when you need to convert code - it is available here. Here is the C# version of the code you've requested:
Hashtable deviceInfo = new Hashtable();
deviceInfo["FontEmbedding"] = "Subset";
byte[] reportBytes = ReportProcessor.Render("PDF", reportToExport, deviceInfo, mimeType, ext, encoding);
Best wishes,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.