ResizeContentsPct
内容
[
隐藏
]ResizeContentsPct(string, string, int[], double, double)
调整文档页面内容的大小。 缩小页面内容并添加边距。 以百分比指定新内容大小。
public bool ResizeContentsPct(string source, string destination, int[] pages, double newWidth,
double newHeight)
范围 | 类型 | 描述 |
---|---|---|
source | String | 源文档的路径。 |
destination | String | 将保存结果文档的路径。 |
pages | Int32[] | 页面索引数组。如果为 null,则将处理所有文档页面。 |
newWidth | Double | 页面内容的新宽度(以百分比为单位)。 |
newHeight | Double | 以百分比为单位的页面内容的新高度。 |
返回值
如果调整大小成功,则为 true。
例子
PdfFileEditor fileEditor = new PdfFileEditor();
fileEditor.ResizePct("input.pdf", "output.pdf",
//调整文档所有页面的大小
null,
//新内容宽度 = 初始大小的 60%
60,
//新内容高度 = 初始大小的 60%
60);
// 页面的剩余区域为空(页边距)。左右边距大小为 (100% - 60%) / 2 = 20%
// 上边距和下边距相同。
也可以看看
- class PdfFileEditor
- 命名空间 Aspose.Pdf.Facades
- 部件 Aspose.PDF
ResizeContentsPct(Stream, Stream, int[], double, double)
调整文档页面内容的大小。 缩小页面内容并添加边距。 以百分比指定新内容大小。
public bool ResizeContentsPct(Stream source, Stream destination, int[] pages, double newWidth,
double newHeight)
范围 | 类型 | 描述 |
---|---|---|
source | Stream | 包含源文档的流。 |
destination | Stream | 将保存结果文档的流。 |
pages | Int32[] | 页面索引数组。如果为 null,则将处理所有文档页面。 |
newWidth | Double | 页面内容的新宽度(以百分比为单位)。 |
newHeight | Double | 以百分比为单位的页面内容的新高度。 |
返回值
如果成功调整大小,则为 true。
例子
PdfFileEditor fileEditor = new PdfFileEditor();
Stream src = new Stream("input.pdf", FileMode.Open);
Stream dest = new Stream("output.pdf", FileMode.Create);
fileEditor.ResizePct(src, dest,
//调整文档所有页面的大小
null,
//新内容宽度 = 初始大小的 60%
60,
//新内容高度 = 初始大小的 60%
60);
// 页面的剩余区域为空(页边距)。左右边距大小为 (100% - 60%) / 2 = 20%
// 上边距和下边距相同。
也可以看看
- class PdfFileEditor
- 命名空间 Aspose.Pdf.Facades
- 部件 Aspose.PDF