.docx file contents being cut-off when converted to .pdf

1 Answer 35 Views
General Discussions PdfProcessing WordsProcessing
Chris
Top achievements
Rank 1
Chris asked on 25 Feb 2025, 06:07 PM | edited on 25 Feb 2025, 06:09 PM

The contents of an uploaded .docx file is being cut-off when converted to .pdf file.

 

Code snippet:

var fileFormatProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider(); using (MemoryStream inputFileStream = new MemoryStream()) { this.fileSystemService.GetFile(documentInfo, inputFileStream); if (fileFormatProvider != null) { var document = fileFormatProvider.Import(inputFileStream); using (MemoryStream output = new MemoryStream()) { var pdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider(); pdfProvider.Export(document, output); var newFile = new DocumentInfo() { NameWithPath = outputFileName, DocumentLocation = documentInfo.DocumentLocation }; this.fileSystemService.SaveFile(newFile, output); } }

 

Can someone confirm if this a Telerik side issue, or am I missing a setting or config?

 

Thanks!

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Feb 2025, 06:40 AM

Hello, Chris,

I am sorry to hear that you are facing any difficulties with RadWordsProcessing when converting a DOCX file to PDF format. Indeed, according to the provided screenshots, the exported content is being cut-off. 

Usually, such weird results can be handled by impementing a custom FontsProvider. Even though the following KB article demonstrates HTML to PDF conversion, its approach is relevant for any provider of RadWordsProcessing, e.g. DOCX to PDF conversion as well:

How to Prevent Text with Special Characters from Being Cut Off when converting HTML to PDF using RadWordsProcessing

However, it wouldn't be easy to determine what is the reason behind this undesired behavior without actually having the problematic DOCX file and knowing if the .NET Standard or the .NET Framework version of Document Processing is used. Could you please elaborate?

It is hard for us to investigate the issues without actually having the problematic file. Please try and prepare a sample file without the sensitive information. If you decide you can also send us the original file after submitting a private support ticket from your Telerik account. You can be certain that it will be used only for investigation purposes of this case and your privacy will be respected in the private support ticket.  

Looking forward to your reply. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Chris
Top achievements
Rank 1
commented on 26 Feb 2025, 03:11 PM

I'll gladly provide the original .docx file to you for investigation. Where would I send it? Thanks!
Dess | Tech Support Engineer, Principal
Telerik team
commented on 28 Feb 2025, 03:54 PM

I have provided a reply in the private support ticket you have opened with the sample DOCX file. Please see the provided information and we can continue the further communication there.
Tags
General Discussions PdfProcessing WordsProcessing
Asked by
Chris
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or