Telerik Format Provider to export PDF isn't accurate.

0 Answers 69 Views
WordsProcessing
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
Patrick asked on 05 Aug 2024, 08:34 PM
I am using a PdfFormatProvider to export the stream of a DocX.

I am displayinga preview of this docx as PDF within my application. The problem is, the PDF is not showing the correct spacing, line numbers and other items listed in the docX file.

When I save DocX as PDF it will display everything needed.
Dimitar
Telerik team
commented on 06 Aug 2024, 05:28 AM

Hi Patrick, 

Can you share your code and document? This will allow us to properly investigate this and suggest a solution. 

Thank you in advance for your patience and cooperation. 

Patrick
Top achievements
Rank 1
Iron
Iron
Iron
commented on 06 Aug 2024, 12:41 PM

I am using code right from your website for the suggestion. This gives me a PDF, but it appears to not give me the same result as if I were to saveAS PDF from the docx file it self outside of application.

https://docs.telerik.com/devtools/document-processing/knowledge-base/convert-docx-to-pdf#:~:text=Solution,export%20it%20with%20the%20PdfFormatProvider.

public static void ConverDocxToPdf(string path, string resultPath) 
{ 
    var docxPRovider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider(); 
    var pdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider(); 
 
    var docBytes = File.ReadAllBytes(path); 
    var document = docxPRovider.Import(docBytes); 
 
    var resultBytes = pdfProvider.Export(document); 
    File.WriteAllBytes(resultPath, resultBytes); 
} 
Dess | Tech Support Engineer, Principal
Telerik team
commented on 07 Aug 2024, 02:50 PM

Hi, Patrick,

My name is Dess and I am a member of the Telerik Document Processing team developing the WordsProcessing library. My colleague, Dimitar, brought this thread to my attention so I will be assisting you.

Thank you for sharing the code snippet. However, depending on the specific document, the result may be different according to the specific content. It is hard for us to investigate the issue without actually having the problematic DOCX file. Please try and prepare a sample file without the sensitive information. If you decide you can submit a private support ticket from your Telerik account and also send us the original file. You can be certain that it will be used only for investigation purposes of this case and your privacy will be respected.  
Looking forward to your reply

 

No answers yet. Maybe you can help?

Tags
WordsProcessing
Asked by
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or