Aspose.pdf 如何让页面内容适应缩小后的页面,感谢技术大哥查看。

Aspose.pdf 将原有页面缩小到A4纸大小,缩小后内容只显示原有的4分之一,感谢技术大哥查看。
源文件:pdflj.pdf (7.8 MB)

错误截图:
QQ截图20190907170112.jpg (25.5 KB)

将页面缩放到A4纸大小了,但是里面的内容没有缩放到A4纸大小,如何让页面里面的内容自动适应修改过的页面大小。

        /* //指定用于调整大小的参数
         PdfFileEditor.ContentsResizeParameters parameters = new 
         PdfFileEditor.ContentsResizeParameters(

         PdfFileEditor.ContentsResizeValue.Percents(1), //leftmargin左边缘
         null,                                            //contentswidth 目录宽度
         PdfFileEditor.ContentsResizeValue.Percents(-170),//rightmargin 右边缘
         PdfFileEditor.ContentsResizeValue.Percents(-170),//topmargin 顶边距
                                                          //PdfFileEditor.ContentsResizeValue.Percents(900),
         null,                                            // contentHeight 高度
         PdfFileEditor.ContentsResizeValue.Percents(0));// Bottom margin  底边距
          //调整页面内容的大小
          fileEditor.ResizeContents(pdfDocument6, pages, parameters);*/

复制以下代码便可使用:

     Aspose.Pdf.Document pdfDocument6 = new Aspose.Pdf.Document(pdflj);

      for (int i = 1; i <= pdfDocument6.Pages.Count; i++)
        {
            Aspose.Pdf.Page page = pdfDocument6.Pages[i];
            page.SetPageSize(Aspose.Pdf.PageSize.A4.Width, Aspose.Pdf.PageSize.A4.Height);
            //获取PDF第一页的矩形区域

            Aspose.Pdf.Rectangle rect = pdfDocument6.Pages[i].Rect;

            // 实例化PdfPageEditor实例

            PdfPageEditor ppe = new PdfPageEditor();

            // 绑定源PDF

            ppe.BindPdf(pdflj);
            // 更新页面大小
            ppe.PageSize= PageSize.A4;
            // 设置缩放系数
            //ppe.Zoom = (float)(rect.Width / rect.Height);
            ppe.Zoom = 1.5f;

        }
      pdfDocument6.Save("cc.pdf");

@fhn123456

感谢您与支持人员联系。

您的代码正在放大页面内容。 请详细说明您的要求。 是否要将页面大小和内容更改为A4大小。

对,我是想将页面大小改为A4大小。页面改A4大小成功了,但是里面的内容没有自动缩小到A4大小

@fhn123456

谢谢你的详细信息。
我们正在调查此问题,并会尽快与您分享您的反馈意见。