PdfFileEditor.AddMargins
Contents
[
Hide
]AddMargins(Stream, Stream, int[], double, double, double, double)
Resizes page contents and add specifed margins. Margins are specified in default space units.
public bool AddMargins(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. |
| rightMargin | Double | Right margin. |
| topMargin | Double | Top margin. |
| bottomMargin | Double | Bottom margin. |
Return Value
true if operation was successful.
Examples
PdfFileEditor fileEditor = new PdfFileEditor();
Stream src = new Stream("input.pdf", FileMode.Open);
Stream dest = new Stream("output.pdf", FileMode.Create);
fileEditor.AddMargins(src, dest,
//process pages 1, 2, 3
new int[] { 1, 2, 3},
//left margin is 10 units
10,
//right margin is 5 units
5,
//top margin is 5 units
5,
//bottom margin is 5 units
5);
dest.Close();
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF
AddMargins(string, string, int[], double, double, double, double)
Resizes page contents and add specifed margins. Margins are specified in default space units.
public bool AddMargins(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. |
| rightMargin | Double | Right margin. |
| topMargin | Double | Top margin. |
| bottomMargin | Double | Bottom margin. |
Return Value
true if resize was successful.
Examples
PdfFileEditor fileEditor = new PdfFileEditor();
fileEditor.AddMargins("input.pdf", "output.pdf",
//process pages 1, 2, 3
new int[] { 1, 2, 3},
//left margin is 10 units
10,
//right margin is 5 units
5,
//top margin is 5 units
5,
//bottom margin is 5 units
5);
See Also
- class PdfFileEditor
- namespace Aspose.Pdf.Facades
- assembly Aspose.PDF