I'm using Aspose.PDF for .net (v4.5) and I'm having trouble setting a background image on a section.
I've used the example code provided in the manual and verified that the file exists, image type is set correct, etc but when I call the Save method I'm getting an ArgumentException thrown with a message of "Invalid image info array in PlaceImage method.".
Example code:
Pdf pdf = new Pdf(); Section sec1 = new Section(pdf); pdf.Sections.Add(sec1); sec1.BackgroundImageFile = @"C:\Temp\testbackground.jpg"; sec1.BackgroundImageType = ImageFileType.Jpeg;
I have tested the scenario and I am unable to notice the problem. Can you please share the source image file that you are using so that we can test the scenario at our end.
Please ignore my previous post. After further investigation, I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNET-18726. We will investigate this issue in details and will keep you updated on the status of a correction. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
I am afraid you might not be able to set section background when using Aspose.Pdf for .NET 4.6.0. However, this issue is resolved and its correction will be included in the next release version of Aspose.Pdf for .NET which will be published by the end of this month or early next month. Please be patient and spare us little time. Once the new version becomes available, we would be pleased to update you with the status of correction.
Your cooperation and comprehension is greatly appreciated in this regard. We apologize for your inconvenience.