Impose text over image

Greetings.

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,


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.


Please feel free to contact us for any further assistance.

Best Regards,

Just to clarify:

Do you have some scheme of accepting answers, like the one at StackOverflow?

Or I just can say:

"Thanks, the answer helped me", as it really helped me.

Olter:
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

Olter:

Just to clarify:

Do you have some scheme of accepting answers, like the one at StackOverflow?

Or I just can say:

“Thanks, the answer helped me”, as it really helped me.

Hi Anton,

You can acknowledge the resolution in simple words within the forum thread and it works for us :slight_smile:

Please continue using our products and case of any further query, please feel free to contact.