Click here to Skip to main content
14,929,877 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to avoid spacing coming while converting word to pdf in asp.net?

On converting a word file to PDF spacing is seen in the left,right,top & bottom area. There should not be any space during the conversion.I am using Itextsharp for the same functionality.
Posted
Comments
Afzaal Ahmad Zeeshan 18-Sep-15 7:24am
   
So remove the margins or paddings, can you do that?

I hope you will be able to get options to minimize the amount of margins and paddings applied.

1 solution

Hi Alex,

You can design margins and padding's like below;

C#
Document.DefaultPageSetup.Orientation = MigraDoc.DocumentObjectModel.Orientation.Portrait;
Document.DefaultPageSetup.TopMargin = "10mm";
Document.DefaultPageSetup.LeftMargin = "5mm";
Document.DefaultPageSetup.RightMargin = "5mm";


Try something like above to adjust Top, Left and right margins.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900