We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to Retain PageLayout /Page Setup Word document

Hi,


After manipulating source word document, when we try to save as new document "Page Layout" is not retained. How to solve this?

Please refer the attached samples.



Thanks
Parkavi.M

Attachment: PageLayout_6c3a98f.rar

1 Reply

SY Sethumanikkam Yogendran Syncfusion Team February 3, 2017 09:06 AM UTC

Hi Parkavi,

Thank you for contacting Syncfusion support.

We are unable to reproduce the mentioned “Page Layout” issue with given details. We have tried to reproduce the issue at our end using below sample code.
 
// Loads template Word document.
WordDocument wordDocument = new WordDocument("Source.doc");
// Adds paragraph with text to the section.
wordDocument.LastSection.AddParagraph().AppendText("End of section added one paragraph");
// Modifies the text of first paragraph of the section.
wordDocument.LastSection.Paragraphs[0].Text = "First paragrph of section modified";
// Modifies paragrah format with back color for particular paragraph.
wordDocument.LastSection.Paragraphs[7].ParagraphFormat.BackColor = Color.Yellow;
// Saves and close the Word document instance.
wordDocument.Save("Sourcedoc-DocIO.doc");
wordDocument.Close();
 

We could see the following comparison result while opening the given Word documents in Microsoft Word application. Can you please confirm us whether you are representing this differences as an issue with "Page Layout", if so then kindly share your code snippets or sample on how you have generated this “New.doc” Word document from “Source.doc” Word document there by we could analyze further on the reported issue. 
Source and New Word document at your side 
Source and resultant Word document at our side 
 
 

If not the above differences are the reported issues, then kindly update us clear description of the issue along with screen shot to illustrate the same
which will helpful to provide you the appropriate solution at the earliest..

Please refer the UG link to know more about how to specify page properties using DocIO.

Please let us know if you have any other questions.

Regards,
Sethumanikkam.Y


Loader.
Up arrow icon