16
2015
10

Crop that pdf page horizontaly into 4 pieces and create a new pdf for each piece

 

  

Crop that pdf page horizontaly into 4 pieces and create a new pdf for each piece


 

Document document = new Document("D:\\AP Data\\copy.pdf");
 
//Create the Copy of the page
document.Pages.Insert(2, document.Pages[1]);
document.Pages.Insert(3, document.Pages[1]);
document.Pages.Insert(4, document.Pages[1]);
 
double segment = (document.Pages[1].Rect.Height / 4);
double half = (document.Pages[1].Rect.Height / 2);
double width = document.Pages[1].Rect.Width;
double height = document.Pages[1].Rect.Height;
 
//Create Crops
Aspose.Pdf.Rectangle pageRect = new Aspose.Pdf.Rectangle(0,  height - segment,width , height);
document.Pages[1].CropBox = pageRect;
 
pageRect = new Aspose.Pdf.Rectangle(0, height - half, width, height - segment);
document.Pages[2].CropBox = pageRect;
 
pageRect = new Aspose.Pdf.Rectangle(0, height - half, width, (height - half) - segment);
document.Pages[3].CropBox = pageRect;
 
pageRect = new Aspose.Pdf.Rectangle(0, 0, width, half - segment);
document.Pages[4].CropBox = pageRect;
 
document.Save("D:\\AP Data\\test_Crop.pdf");


« 上一篇下一篇 »

相关文章:

Crop Pdf from each edge   (2015-10-16 8:58:46)

C# Crop PDF File   (2015-10-16 8:57:13)

万兴PDF编辑器 Wondershare PDF Editor  (2014-6-12 12:30:44)

PDF转word  (2014-2-25 16:47:38)

Aspose.PDF功能介绍  (2014-2-20 16:47:23)

Excel转PDF的方法  (2014-2-19 20:20:48)

Aspose.Pdf for .NET实现PDF转Excel、EPS、SVG等  (2014-2-16 16:26:25)

itextsharp去除PDF内的水印  (2014-2-14 14:3:43)

iText去除PDF水印  (2014-2-14 13:29:35)

PDF解析  (2014-2-13 8:46:18)

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。