Aspose Words, Trim and Bleed Boxes for PDF output

Using Aspose.Words, is there a way to set the PDF Trim Box and Bleed Box for output to a PDF File.

I have a one page book cover and I need to set the bleed box and trim box for output to a PDF file … This is an automated process and the printer demands them defined.


Unfortunately, Aspose.Words does not provide the requested feature. However, you can work with PDF document using Aspose.PDF. I am moving this forum thread to Aspose.PDF forum where you will be guided appropriately.


Thank you for contacting support.

You can get or set different page properties of a PDF document as per your requirements. Please visit Get Page Properties for your kind reference.

We hope this will be helpful. Please feel free to contact us if you need any further assistance.

I just need to SET the Trim and Bleed box and I am having problems. Can you provide be a code snippet. I think it starts something like this.

Document doc = new Document();
Page page = doc.Pages[1];


We have devised below code snippet for your kind reference. It includes how the rectangular coordinates, lower left X, Y, upper right X and Y can be set as per your requirements.

//Load source document
Document doc = new Document(dataDir + "Test.pdf");

//get reference to the page of itereate through each page with foreach loop
//foreach (Page page in doc.Pages)
Page page = doc.Pages[1];

//Get height and width of existing page, if needed
PdfFileInfo info = new PdfFileInfo(doc);
float width = info.GetPageWidth(page.Number);
float height = info.GetPageHeight(page.Number);

page.BleedBox.LLX = 10;
page.BleedBox.LLY = 10;
page.BleedBox.URX = width - 10;
page.BleedBox.URY = height - 10;

page.TrimBox.URX = 100;

doc.Save(dataDir + "Bleedbox.pdf");

Thanks for the reply. I tried the code but the values are not saving. I am not sure what I am doing wrong. Art of Romance.pdf (1.7 MB)

I have the PDF I am working with. Do I have to set some other setting first?


Would you please share your source file while mentioning the values you want to set, as well as expected output document so that we may investigate your requirements and assist you accordingly.