AddMarginsPct
Contents
[
Hide
]AddMarginsPct(Stream, Stream, int[], double, double, double, double)
Resizes page contents and add specified margins. Margins are specified in percents of intitial page size.
public bool AddMarginsPct(Stream source, Stream destination, int[] pages, double leftMargin,
double rightMargin, double topMargin, double bottomMargin)
Parameter | Type | Description |
---|---|---|
source | Stream | Stream which contains source document. |
destination | Stream | Stream where resultant document will be saved. |
pages | Int32[] | Array of page indexes. If null then all document pages will be processed. |
leftMargin | Double | Left margin in percents of initial page size. |
rightMargin | Double | Right margin in percents of initial page size. |
topMargin | Double | Top margin in percents of initial page size. |
bottomMargin | Double | Bottom margin in percents of initial page size. |
Return Value
true if action was performed successfully.
Examples
PdfFileEditor fileEditor = new PdfFileEditor();
Stream src = new Stream("input.pdf", FileMode.Open);
Stream dest = new Stream("output.pdf", FileMode.Create);
fileEditor.AddMarginsPct(src, dest,
//process pages 1, 2, 3
new int[] { 1, 2, 3},
//left margin is 15% of page width
15,
//right margin is 10% of page width
10,
//top margin is 20% of page width
20,
//bottom margin is 5% of page width
5);
dest.Close();
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF
AddMarginsPct(string, string, int[], double, double, double, double)
Resizes page contents and add specified margins. Margins are specified in percents of intitial page size.
public bool AddMarginsPct(string source, string destination, int[] pages, double leftMargin,
double rightMargin, double topMargin, double bottomMargin)
Parameter | Type | Description |
---|---|---|
source | String | Path to source document. |
destination | String | Path where resultant document will be saved. |
pages | Int32[] | Array of page indexes. If null then all document pages will be processed. |
leftMargin | Double | Left margin in percents of initial page size. |
rightMargin | Double | Right margin in percents of initial page size. |
topMargin | Double | Top margin in percents of initial page size. |
bottomMargin | Double | Bottom margin in percents of initial page size. |
Return Value
true if resize was successful
Examples
PdfFileEditor fileEditor = new PdfFileEditor();
fileEditor.AddMarginsPct("input.pdf", "output.pdf",
//process pages 1, 2, 3
new int[] { 1, 2, 3},
//left margin is 15% of page width
15,
//right margin is 10% of page width
10,
//top margin is 20% of page width
20,
//bottom margin is 5% of page width
5);
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF