We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to crop PDF?

i have one page pdf of size 8" * 11". I want to crop that pdf page horizontaly into 4 pieces and create a new pdf for each piece. Can i do that using ASPOSE.PDF

So there will be four 8" * 2.75" pieces.

Any updates on this? at least “yes” or “no”

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Sorry for the delayed response.

I think you can create the copies of the page and then crop each copied page to get your desired results. Please see the following sample code for your reference and check if it fits your need:

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");

Thank You & Best Regards,