Add watermark in PDF document using Aspose.PDF for .NET - Invalid array format

Hello there:
When we use Aspose.Total for .NET to watermark a PDF file, it will report “Invalid array format. What is the reason for this? What should I do to eliminate this error?”
hope to get your reply
best wishes

@xiangliling,

Thanks for contacting support.

Can you please share source file along with sample code and complete error details. We will investigate this scenario in our environment to help you out.

Error code: pdfDocument.Pages [Page_counter] .ArtBox reports an error directly
Error message:
‘pdfDocument.Pages [Page_counter] .ArtBox’ threw an exception of type ‘System.ArgumentException’

Code example:
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document (stream);
for (int Page_counter = 1; Page_counter <= pdfDocument.Pages.Count; Page_counter ++)
{
Ranch
string width = pdfDocument.Pages [Page_counter] .ArtBox.Width;
string height = pdfDocument.Pages [Page_counter] .ArtBox.Height;
}

@xiangliling,

Can you please share complete working sample code along with source file as well to further investigate.