Both produce a blank pdf (except for the eval message).
The code from git hub example
// The path to the documents directory.
string dataDir = Path.GetFullPath(“…/…/…/Data/”);
<span style="color: green;">// create a new Document object</span>
<span style="color: rgb(43, 145, 175);">Document</span> doc = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">Document</span>();
<span style="color: green;">// add a new page to document object</span>
<span style="color: rgb(43, 145, 175);">Page</span> page = doc.Pages.Add();
<span style="color: green;">// create BackgroundArtifact object</span>
<span style="color: rgb(43, 145, 175);">BackgroundArtifact</span> background = <span style="color: blue;">new</span> <span style="color: rgb(43, 145, 175);">BackgroundArtifact</span>();
<span style="color: green;">// specify the image for backgroundartifact object</span>
background.BackgroundImage = <span style="color: rgb(43, 145, 175);">File</span>.OpenRead(dataDir + <span style="color: rgb(163, 21, 21);">"aspose-total-for-net.jpg"</span>);
<span style="color: green;">// add backgroundartifact to artifacts collection of page</span>
page.Artifacts.Add(background);
<span style="color: green;">// save the document</span>
doc.Save(dataDir + <span style="color: rgb(163, 21, 21);">"output.pdf"</span>);</pre></div></div><div><br></div><div>I'm currently using the eval version of Aspose.pdf , but this is a key requirement for us and is stopping my company from purchasing. Please can you advise how to get this working.</div><div><br></div><div>Many Thanks.</div><div><br></div><div><br></div><div><br></div>
Thanks for your considering Aspose. Aspose.Pdf evaluation version has two limitations, evaluation watermark and at most four elements of any collection can be viewed. Please make a request for 30 days temporary license to evaluate our product without any limitation. It will resolve the issue and help you to accomplish the task.
Please feel free to contact us for any further assistance.
Thanks for your help, this is working perfectly with the trial license. However, the above code doesn’t appear to be using more than 4 items in a collection, so I can only assume it’s the inners of the Aspose dll that flagged the eval limitation.
Thanks for your feedback. It is good to know that your issue has been resolved. Moreover, in reference to your findings, we will investigate it internally and will fix with proper exception implemenation.
Please feel free to contact us for any further assistance.
One more thing, I now have a background image working, it’s A4 in size, so fits the full page, however, it is positioned slightly to the right of the page.
Is there a margin or positioning that I need to set so that it appears centrally?
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.