PDF Compress

6 posts, 0 answers
  1. Nisarg
    Nisarg avatar
    25 posts
    Member since:
    Dec 2011

    Posted 22 Dec 2015 Link to this post

    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

  2. Tanya
    Admin
    Tanya avatar
    402 posts

    Posted 23 Dec 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Nisarg
    Nisarg avatar
    25 posts
    Member since:
    Dec 2011

    Posted 24 Dec 2015 Link to this post

    Hi Tanya,

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

    Thanks

  5. Nisarg
    Nisarg avatar
    25 posts
    Member since:
    Dec 2011

    Posted 28 Dec 2015 Link to this post

    Hi Tanya,

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

    Thanks

     

  6. Tanya
    Admin
    Tanya avatar
    402 posts

    Posted 28 Dec 2015 Link to this post

    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
  7. Nisarg
    Nisarg avatar
    25 posts
    Member since:
    Dec 2011

    Posted 29 Dec 2015 Link to this post

    Hi Tanya,

    Thanks for your quick reply.

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

    Thanks

Back to Top
UI for WPF is Visual Studio 2017 Ready