7 Answers, 1 is accepted
Sorry - I should have included code:
This gets the letter from the DOCX:
I then modify some fields in the document:
And when the document fields have been populated I save the document as a PDF:
RenderedBytes1 is then stored in the database.
This all works BUT the header and footer are not shown in the document.
Any help massively appreciated!
I am having a similar issue with headers/footers not being included in the import from a docx document.
How can I view support ticket 1081869?
I am afraid you would not be able to see the ticket with ID 1081869 as it is a support thread. However, I can share with you what the problems were in this particular case.
The first problem was with floating images in the client document, the floating images are not yet implemented when exporting to PDF format. Here is a link to the feature request: Support for floating images when exporting to PDF
The second problem was with images inserted as Alternate Content. This feature also is not yet implemented. Here is the link to the item in our feedback portal: Add support for images defined as alternate content
If you have a specific question for a particular document you could start a new support thread and provide the document in question. This way we will be able to investigate your scenario.
Telerik by Progress
Hi Mihail, thanks for the info.
The template document header does contain an image, Line shape, and page numbers. The header for the first page also differs from the rest.
In our particular scenario we are importing a docx, replacing some text then exporting as docx or pdf depending on certain conditions.
In either case, the headers are empty.
When I remove these elements and just use plain text in the headers, they come through fine.
You mentioned images are not yet supported, what about page numbers and shapes?
I would like to point out that inline images are supported for export to PDF format. This means that if there are floating images or images placed as an alternate content, you can convert them to inline images and they will be exported.
I am afraid that shapes are not yet implemented which explains why they are not exported. Here is a link to a feature request in our feedback portal: Add support for shapes.
Regarding the page number field, this field is not supported out of the box in words processing. Here is a link to a feature request in our feedback portal: Page Numbering Fields - PAGE, NUMPAGES.
Nevertheless, if the field code is declared only as "PAGE" without additional options, it will be exported correctly to PDF format. If this is suitable for your scenario you could iterate over all of the fields code fragments and only for the page field to replace it with the "PAGE" code. Here a link to a help article explaining how the fields are working: Fields
I hope this information is helpful.
Telerik by Progress
Images are showing up along with the page numbers now. As for the shapes I just replaced them with images