Add Text with Transparency in PDF Document using Aspose.PDF for .NET

Hi All,

<o:p></o:p>

I would like to ask you a query regarding Apose.Pdf.Net. My requirement is to add a “multiline transparent textbox” over PDF page. For more explanation you can see attached sample PDF.

Any help is highly anticipated.

Thanks in advance.

Regards,

Ashish

Hi Ashish,


Thanks for your interest in our products.

In order to fulfill your requirements, you may consider adding TextStamp to pages of existing PDF file. Please try using the following code snippet to accomplish your requirement.

[C#]

//open document<o:p></o:p>

PdfFileStamp fileStamp = new PdfFileStamp();

fileStamp.BindPdf("c:/pdftest/test_pdf.pdf");

//Instantiate a stamp object

Aspose.Pdf.Facades.Stamp logoStamp = new Aspose.Pdf.Facades.Stamp();

logoStamp.Opacity = 0.5f;

logoStamp.SetOrigin(100, 100);

//Instantiate an object of FormattedText class

FormattedText formatText = new FormattedText("Hello World!",System.Drawing.Color.FromArgb(180, 0, 0), Aspose.Pdf.Facades.FontStyle.TimesItalic, EncodingType.Winansi, false, 50);

//Add another line for Stamp

formatText.AddNewLineText("Good Luck");

//BindLogo to PDF

logoStamp.BindLogo(formatText);

//add stamp to PDF file

fileStamp.AddStamp(logoStamp);

// save stamped PDF file

fileStamp.Save(“c:/pdftest/MultiLineStamp.pdf”);



For further information, please visit

Hi Nayyer,


First of all thanks for the response and the code provided by you.


I am afraid to say that you did not get it correctly as my requirement is different from the output produced by code provided by you.


Let explain my requirement once again. I need to add a transparent (say opacity 30%) rectangle on any certain location. Then we need to add multiline text over the transparent box, however our text will not be transparent. Please see again the attached pdf in my first post.


Please let me know if you need further clarification.


Thanks in advance.


Regards,

Ashish

Hi Nayyer,


Any update on this. Support is highly requested.


Thanking you in advance.


Regards,

Ashish

Hi Ashish,


I am working over this query and will get back to you soon. We are sorry for this delay and inconvenience.

r@innodata.com:
Let explain my requirement once again. I need to add a transparent (say opacity 30%) rectangle on any
certain location. Then we need to add multiline text over the transparent box,
however our text will not be transparent. Please see again the attached pdf in
my first post.
Hi Ashish,

Thanks for sharing the information.

I have gone through your explanation in details and I am afraid the requested feature is currently not
supported but for the sake of implementation, I have logged this requirement in
our issue tracking system under New Features list as PDFNEWNET-35380. We
will further investigate this requirement in details and will keep you updated
on the status of a correction.

We apologize for your inconvenience.