Converting DocX to PDF - Margins and Padding lost

2 posts, 0 answers
  1. Yacoob
    Yacoob avatar
    1 posts
    Member since:
    Feb 2014

    Posted 04 Jul Link to this post

    We're converting a DocX file stream to a PDF file stream but we're getting some weird results with the padding on many elements. In a clean, new document, the Margins are always 2.54cm and the individual padding of tables is completely lost. If we try to edit the Margins (even if we change to a new value and back again), the Margins then drop to 0cm from then on and the table padding is still not applied. The conversion code can be found below:

    var providerDocx = new DocxFormatProvider();
                var document = providerDocx.Import(response.Data.Document);
                var providerPdf = new PdfFormatProvider
                {
                    ExportSettings = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExportSettings
                    {
                        ComplianceLevel = PdfComplianceLevel.PdfA2B,
                        ImageQuality = ImageQuality.High
                    }
                };
                var outStream = new MemoryStream();
                providerPdf.Export(document, outStream);

    Any help or insight you could provide would be appreciated.

    Thanks

  2. Peshito
    Admin
    Peshito avatar
    546 posts

    Posted 06 Jul Link to this post

    Hi Yacoob,

    Currently, RadWordsProcessing does not support all features for its DOCX to PDF conversion which results in differences in the converted file. There is a feature request logged in our feedback portal to "Add support for table cell padding and table cell spacing when exporting to PDF format". You could follow and vote for this item in order to get notified when its development status is changed.

    Regards,
    Peshito
    Progress Telerik

Back to Top