Unplanned
Last Updated: 07 Jun 2022 11:25 by ADMIN
ADMIN
Deyan
Created on: 25 Apr 2016 17:19
Category: WordsProcessing
Type: Bug Report
3
WordsProcessing: Paragraph containing a single Run with an empty string is not exported to PDF
This is only reproducible when the Run contains an empty string. If the paragraph is empty or the Run contains a space, everything is working correctly.

Workaround: Remove all empty runs from the document.
2 comments
ADMIN
Svilen
Posted on: 07 Jun 2022 11:25

Hello, Alexander,

Allow me to elaborate on the issue here as in our private conversation, so this information might be useful to others as well.

In the OpenXML "document" file in its XML structure, the empty paragraphs contain a specific  OpenXML element called a "run", which is empty. When opening the .docx file in MS Word, there is no way to see these runs but they are the cause for empty paragraphs not being exported to PDF. In the workaround, by removing the empty runs, we will preserve the "empty" paragraphs and our API will be able to properly export the new lines to the PDF file.

When exporting to PDF, the file is first loaded in memory, before this fix is applied. This does not affect the original file and allows for the exported PDF to properly show the empty lines. I've attached a small sample project, which does this. 

Please let me know if the exported PDF file is satisfactory to you.

Regards,
Svilen
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Attached Files:
Александр
Posted on: 06 Jun 2022 18:56
Hello!
It is not always possible to delete empty runs. In my case, it is absolutely impossible to do this, because there is an approved sample (Word file) and export to PDF must comply with it