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

PDF Compress

5 Answers 46 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Nisarg
Top achievements
Rank 1
Nisarg asked on 22 Dec 2015, 12:22 PM
Hi,

I have  2014.1.331.40 version

I am using mail merge functionality of telerik RichTextBox. It working good but when I export mail merge document to pdf, it generates more than 1 mb pdf file.
I am not adding any image in the pdf file.

After PdfExportSettings below property, its generate 450 to 500 kb pdf files.

PdfFormatProvider _PdfFormatProvider = new PdfFormatProvider();
PdfExportSettings _PdfExportSettings = new PdfExportSettings();
_PdfExportSettings.ContentsCompressionMode = PdfContentsCompressionMode.Automatic;
_PdfExportSettings.ContentsDeflaterCompressionLevel = 9;
_PdfExportSettings.FloatingUIContainersExportMode = PdfInlineUIContainersExportMode.Image;
_PdfExportSettings.ImagesCompressionMode = PdfImagesCompressionMode.Automatic;
_PdfExportSettings.ImagesDeflaterCompressionLevel = 9;
_PdfExportSettings.InlineUIContainersExportMode = PdfInlineUIContainersExportMode.Image;
_PdfFormatProvider.ExportSettings = _PdfExportSettings;

Is there any option by which I can manage pdf file size upto 150 kb?

Thanks

5 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 23 Dec 2015, 03:28 PM
Hi Nisarg,

The compression of the PDF files depends on the compression settings applied to the PdfFormatProvider. I can see that you have already set them and I am not sure how we could reduce the size of the file. 

However, if you could share the .docx file we will test it and check if it is possible to decrease the size of the produced .pdf.

Regards,
Tanya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Nisarg
Top achievements
Rank 1
answered on 24 Dec 2015, 09:13 AM

Hi Tanya,

 Is there any option by which I can convert  mail merge document to images (png, jpg) instead of PDF, Doc etc...

Thanks

0
Nisarg
Top achievements
Rank 1
answered on 28 Dec 2015, 02:19 PM

Hi Tanya,

I have created new support ticket ID 997958 with the demo project for the same issue.

Thanks

 

0
Tanya
Telerik team
answered on 28 Dec 2015, 03:41 PM
Hi Nisarg,

Thank you for sending the project.

We examined the produced PDF document and noticed that there is 6 fonts used for it. You could check which exactly they are when you open the document in Adobe - the Fonts tab from the Document Properties dialog will give you the information.

As these fonts are embedded in the document, they are increasing its size. In this case, even if you add more content in the document (without changing the styles and adding more fonts), you will notice that the size of the produced file won't increase much. This is because the biggest memory retainer are the embedded in the document fonts.

With this said, I am afraid I cannot suggest you an approach to decrease the size of the file.

Exporting RadRichTextBox to an image is not currently supported. However, we have this feature already in our backlog and you could vote and subscribe to the related public item in order to receive updates if its status changes.

You could achieve similar functionality following the approach in the attached project. It demonstrates how to generate an image from the first page of the RadDocument using the RenderTargetBitmap class.

Hope this helps.

Regards,
Tanya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Nisarg
Top achievements
Rank 1
answered on 29 Dec 2015, 01:06 PM

Hi Tanya,

Thanks for your quick reply.

I have replied with support ticket ID 997958 with the demo project for some new queries.

Thanks

Tags
RichTextBox
Asked by
Nisarg
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Nisarg
Top achievements
Rank 1
Share this question
or