After saving to pdf- the document's cover page has lost


hi

a very simple document, then add a cover, finally output to pdf format.


the cover page has disappear.

please using attechment for further testing. thanks.


in use 14.4

Hi Pyntia,


Thanks for your inquiry. While using the latest version of Aspose.Words i.e. 14.4.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-10089. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,
Hi Pyntia,

Regarding WORDSNET-10089, our development team has completed the work on your issue and has come to a conclusion that this issue and the undesired behaviour you're observing is actually not a bug. So, we have closed this issue as 'Not a Bug'.

To resolve this problem, you need to call doc.UpdatePageLayout() method before saving to PDF. This is needed because UpdateFields method was called inside CreateTOC method before cover page was added. Alternatively, you need to re-order calls so that InsertTOC is called last. I hope, this helps.

Best regards,

hi, Awais


thanks a lot.

it really can work now. but i confuse that why these code save to docx format can work perfect without calling UpdatePageLayout() api.

Hi Pyntia,


Thanks for your inquiry. This is because Document.UpdateFields method was first called from CreateTOC method and then cover page was added. In this case, the cover page content is inserted into the Document Object Model but the layout of the pages will not be rebuilt to include this change until the page layout is updated again. The up-to-date page layout information is required for a correct rendering of the document to fixed-page formats, that is why you need to issue a call to Document.UpdatePageLayout() method before saving to PDF.

Best regards,