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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Different Margins on first page

Thread ID:

Created:

Updated:

Platform:

Replies:

96909 Oct 12,2010 03:04 PM UTC Oct 19,2010 03:51 AM UTC ASP.NET Web Forms (Classic) 5
loading
Tags: DocIO
John SivillaDUPLICATE
Asked On October 12, 2010 03:04 PM UTC

Hi,

I am wondering if there is a way to have different margins on the first page of a document created with DocIO?

thanks in advance,
John


Gunasekaran T [Syncfusion]
Replied On October 13, 2010 06:25 AM UTC

Hi John,

Thank you for using Syncfusion products.

We have created a sample application to illustrate your requirement to apply different margin for first page of a word document created using DocIO. Please do find the sample in the attachment.

Please let us know if you have any other questions.

Regards,
Gunasekaran




Sample_1916dacf.zip

John Sivilla
Replied On October 13, 2010 07:22 PM UTC

Thanks Gunasekaran for the sample code it is very kind.

Unfortantely, there is still an issue with the snippet.

In your code you
add a section to the document, set it's margins which appears on the first page, and add a break code.

You then add a paragraph, which is the only content which appears on the first page and then you set the section to null

The next step is that you add another section to the document, set different margins to it, and then add content that appears on all subsequent pages with the new margins.

The problem I am having with this is that I have content on the first page which may be longer than a page. According to your example, this is not possible. Please let me know if I am missing something or if there is a way to fix this.

thanks,
John






Gunasekaran T [Syncfusion]
Replied On October 14, 2010 07:03 AM UTC

Hi John,

Thank you for your update.

In MS Word document the page margins will be applied for all the pages in a section. Different page margins cannot be applied for the pages in a section. In your case, the content that exceeds the first page can be added to a new section in order to apply different margin for first page.

Please let us know if you have any other questions.

Regards,
Gunasekaran



John SivillaDUPLICATE
Replied On October 18, 2010 05:21 PM UTC

Hi Gunasekaran,

thanks once again for your response.

I just wanted to let you know that I did manage to get it working despite my requirement. I simply set SectionBreakCode.NoBreak on my second section. I had no break code previously. This did not break the section to the second page but rather continued from right after the first section, which contains the margins for the first page.

John




Gunasekaran T [Syncfusion]
Replied On October 19, 2010 03:51 AM UTC

Hi John,

Thank you for your update.

Please set the break code for the second section as SectionBreakCode.NewPage for your requirement to apply different margin for first page. The SectionBreakCode.NewPage sets the section to start from a new page, Whereas SectionBreakCode.NoBreak sets the section to continue from the end of previous section.

Please let us know if you have any other questions.

Regards,
Gunasekaran



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;