Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Dec 26, 2014 1:41 pm

Hi Team,
In my PDF document I have couple of Hyperlinks. I am trying to modify the hyperlink address and hyperlink text by following the
code provided in this site.

Spire.Pdf.PdfDocument PdfDocument = new Spire.Pdf.PdfDocument();
PdfDocument.LoadFromFile(@"D:\DownloadedDocs\VertexQATest002\run.pdf");
PdfPageBase page = PdfDocument.Pages[0];
PdfAnnotationCollection widgetCollection = page.AnnotationsWidget;

But here we are getting widgetCollection count as 0.Please provide the solution asap.

ashokisha
 
Posts: 3
Joined: Wed Dec 24, 2014 12:25 pm

Mon Dec 29, 2014 3:42 am

Dear ashokisha,

Sorry for the delay reply.

To help us reproduce this issue, please upload your sample document to the forum, or you can send it to burning.liu@e-iceblue.com
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Wed Dec 31, 2014 7:05 am

Hi Team,
I have uploaded the pdf document which is required to modify the Hyperlinks and Hyperlink Text[TexttoDisplay].In Uploaded document I have collection of Hyperlinks.These hyperlink I need to get in c#.net application and have to update hyperlink and hyperlink text.


Many Thanks
Ashok

ashokisha
 
Posts: 3
Joined: Wed Dec 24, 2014 12:25 pm

Wed Dec 31, 2014 8:32 am

Dear ashokisha,

Sorry that I see nothing in the attachment, please zip them before uploading.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Wed Dec 31, 2014 12:56 pm

Hii Team,
I have attached ppt and pdf zip files with this mail.Please check the attached documents.


Requirement :we have to update PDF and PPT Hyperlinks and Hyperlink Text[Texttodisplay] from our c#.net Application.

ashokisha
 
Posts: 3
Joined: Wed Dec 24, 2014 12:25 pm

Thu Jan 01, 2015 6:51 am

Hello,

Thanks for the information.
After an initial test with the latest hotfix(Spire.PDF Pack(Hot Fix) Version:3.2.31), it can get the Hyperlinks, please download the latest hotfix and try the following method to modify the links.
Code: Select all
 PdfDocument doc = new PdfDocument();
doc.LoadFromFile("amaximusPDF.pdf");
 PdfPageBase page = doc.Pages[0];
PdfAnnotationCollection widgetCollection = page.AnnotationsWidget;
if (widgetCollection.Count>0)
            {
                foreach(var obj in widgetCollection)
                {
                   if(obj is PdfUriAnnotationWidget )
                   {
                       PdfUriAnnotationWidget link = obj as PdfUriAnnotationWidget;
                       link.Uri = "http://www.e-iceblue.com";
                   }
                }
            }
 doc.SaveToFile("result.pdf");

In addition, regarding the ppt document, it might be not able to get the hyperlinks, I have posted the issue to our Dev team, oncet there are any update, we will let you know immediately.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Fri Jan 02, 2015 2:11 am

Dear ashokisha,

Have you tried the code snippet to update hyperlinks and hyperlink text? Did it work?

Looking forward to your response.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Return to Spire.PDF