We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

CreateWebLink

How I can change the color of the System.Drawing.Rectangle which I have to set when creating a web link in a PDF?

When setting a web link with CreateWebLink the result is a rectangle with a black border. I want to be able to set the color.

My issue: when the user clicks on an image the browser should open a link. So I add the image with PdfMend und afterwards I create a the same position a weblink with PdfContentEditor. But the border color of the rectangle should be white.


Thank your for your answer.

Please provide whole codes which can reproduce the error.

I don’t know if this is an error. Shouldn’t the color of the rectangle border be black? Should it be transparent?

Here my code which produces a black bordered rectangle in front of the added image:

[…]
FileStream l_FStream = new FileStream(, FileMode.Open);
FileStream l_IStream = new FileStream(<image.jpg>, FileMode.Open);
FileStream l_SStream = new FileStream(, FileMode.Create);

l_FStream.Seek(0, SeekOrigin.Begin);
PdfFileMend l_PdfMend = new PdfFileMend(l_FStream, l_SStream);
l_PdfMend.AddImage( l_IStream, 1, 30,30,90,90);

l_PdfMend.Close();
l_SStream.Close();
l_SStream = new FileStream(, FileMode.Open);

PdfContentEditor l_Editor = new PdfContentEditor();

System.Drawing.Rectangle l_Rect = new System.Drawing.Rectangle(30,30,60,60);
l_Editor.BindPdf(l_SStream);
l_Editor.CreateWebLink(l_Rect, , 1);
l_Editor.Save();
[…]

hi tiredwarlord ,

currently, CreateWebLink can not modify the color of rectangle , I will improve this interface to support modify the color ASAP, when finished, I will post the news here .

best regards


When do you expect to offer a new hotfix-release with this improved interface? Time is money. :slight_smile:


Thanks.

we have add a CreateWebLink interface to support modify the color of rectangle in the new version, it should be provided to you as soon.