Posted by a ceTe Software moderator
Hi,
If you are looking for CropBox, BleedBox and TrimBox dimensions then you can retrieve these values from an existing PDF page using DynamicPDF Core Suite for .NET product.
Here is a code sample.
PdfDocument pdf = new PdfDocument(@"Source PDF file path");
MergeDocument document = new MergeDocument(pdf);
// Read CropBox values
float cropBoxHeightLeft = document.Pages[0].Dimensions.CropBox.Left;
float cropBoxHeightTop = document.Pages[0].Dimensions.CropBox.Top;
float cropBoxHeightRight = document.Pages[0].Dimensions.CropBox.Right;
float cropBoxHeightBottom = document.Pages[0].Dimensions.CropBox.Bottom;
float cropBoxHeightValue = document.Pages[0].Dimensions.CropBox.Height;
float cropBoxWidthValue = document.Pages[0].Dimensions.CropBox.Width;
// Similarly for BleedBox
float bleedBoxHeightValue = document.Pages[0].Dimensions.BleedBox.Height;
float bleedBoxWidthValue = document.Pages[0].Dimensions.BleedBox.Width;
// ...
// Similarly for TrimBox
float trimBoxHeightValue = document.Pages[0].Dimensions.TrimBox.Height;
float trimBoxWidthValue = document.Pages[0].Dimensions.TrimBox.Width;
// ...
Feel free to download fully functional evaluation edition of DynamicPDF Core Suite for .NET product from NuGet (Package ID: ceTe.DynamicPDF.CoreSuite.NET) or from our website
here
Thanks,
ceTe Software Support Team