My company decided to move from Infragistics to Telerik .
For PDF development I am using Telerik.Windows.Documents.Flow.FormatProviders.Pdf and Telerik.Windows.Documents.Flow.Model.RadFlowDocument to create PDF.PDF is complex with tables/images etc but I did not have any issue there.Everything was as in Telerik online spec.
Now I have different issue that was almost stopover for me.PDF that I got with Telerik is 10 times bigger in size then with Infragistics.
Example bellow will create the simplest PDF doc with only one line of text, and that document is 245 kb.Same example with Infragistic is 14 kb.
Exact same relations is also when I add images in..I can see that Telerik document is much higher in quality [when I put images] but we prefer size/performance then quality of PDF.
Can you point what I have to change? Is any FormatProviders.Pdf settings that I can use to create smaller size document ?Or ?
class TEST
{
public void ExportToPdf(string PdfURL)
{
Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider provider =
new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
using (Stream output = File.OpenWrite(PdfURL))
{
Telerik.Windows.Documents.Flow.Model.RadFlowDocument document = CreateRadFlowDocument();
provider.Export(document, output);
}
}
private Telerik.Windows.Documents.Flow.Model.RadFlowDocument CreateRadFlowDocument()
{
RadFlowDocument document = new RadFlowDocument();
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);
editor.ParagraphFormatting.TextAlignment.LocalValue = Alignment.Justified;
Section section = editor.InsertSection();
section.PageMargins = new Telerik.Windows.Documents.Primitives.Padding(4);
section.PageOrientation = Telerik.Windows.Documents.Model.PageOrientation.Landscape;
//test text
editor.InsertText("TEST Telerik.Windows.Documents.Flow.Model.RadFlowDocument PDF ");
return document;
}
}