I'm working with Aspose.Pdf for .Net and now, for some reason, I need a possibility to impose some text over image. Image is generated dynamically but has always the same size. Is it possible to print text at some calculated coordinates over it?
For now, images and text are added like this:
section.Paragraphs.Add(paragraph);
where paragraph object contains either table with saved text/plain text, or image, saved in stream.
Thanks for your inquiry. It seems you are creating a PDF from scratch using Aspose.Pdf.Generator. I’m afraid Aspose.Pdf.Generator namespace doesn’t support adding watermark or stamp. As a workaround you can save your PDF document to memory stream and pass to Aspose.Pdf.Document class to add watermark/stamp over PDF page. Please check following documentation link for the details/code snippets.
I’m working with Aspose.Pdf for .Net and now, for some reason, I need a possibility to impose some text over image. Image is generated dynamically but has always the same size. Is it possible to print text at some calculated coordinates over it?
For now, images and text are added like this:
section.Paragraphs.Add(paragraph);
where paragraph object contains either table with saved text/plain text, or image, saved in stream.
Hi Anton,
Adding more to Tilal’s comments, when creating PDF file using Aspose.Pdf.Generator namespace, you can use FloatingBox object to place Text/Image as watermark. The default layout of PDF file is Flow layout Top-Left to Bottom-Right. Whereas FloatingBox uses Absolute positioning of contents. So you can place the FloatingBox at any location over the PDF file. For further information, please visit Customizing Watermark