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

Converting DocX to PDF - Margins and Padding lost

1 Answer 351 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
Yacoob
Top achievements
Rank 1
Yacoob asked on 04 Jul 2018, 12:42 PM

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

1 Answer, 1 is accepted

Sort by
1
Peshito
Telerik team
answered on 06 Jul 2018, 02:01 PM
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

Tags
PdfProcessing
Asked by
Yacoob
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or