I have written a procedure that includes some docx in a main document. The included files styles are different from the main document styles.
The resulting document is ok: each file still looks like before the inclusion.
The problem is that after the conversion to pdf, the main document style overwrites the includes files styles, and the original layout is lost.
Here is the conversion code:
var convert = new Aspose.Words.Document(path);
convert.SaveToPdf(path.Replace(".docx", ".pdf"));
See attached the layout in the docx and in the pdf files.
Kind regards
Roberto
Thanks for your inquiry. Could you please attach your input and output documents here for testing? I will investigate the problem on my side and provide you more information.
Also, as I can see you use some old version for testing. Please try using the latest version of Aspose.Words (9.4.0) and let me know how it goes on your side. You can download this version from here: https://releases.aspose.com/words/net
That means that your pdf has the same layout as the docx using the code lines I have provided?
In that case, could you please attach your result?
Thank you
Roberto