hi,
R\00Z#o\0\0\0\0\0\0\0\0\0\0!\00Z#!\0\0\0lÞ\0,
R\00Z#!\0\0\0\0!\0\0\0\0\0\0\0R\0\0\0\0\0\0\0!\00Z#!\0\0\0¤Þ\0,
R\00Z#!\0\0\0\0!\0\0\0\0\0\0\0R\0\0\0\0!\0!\0\0\0\0"
hi,
Hi Chenna,
//
Load source PDF file containing hyperlinks<o:p></o:p>
Document document = new Document("c:/pdftest/define.pdf");
// Traverse through all the page of PDF
foreach (Aspose.Pdf.Page page in document.Pages)
{
// Get the link annotations from particular page
AnnotationSelector selector = new AnnotationSelector(new Aspose.Pdf.InteractiveFeatures.Annotations.LinkAnnotation(page, Aspose.Pdf.Rectangle.Trivial));
page.Accept(selector);
// Create list holding all the links
IList list = selector.Selected;
Console.WriteLine("Number of links = "+ list.Count);
// Iterate through invidiaul item inside list
foreach (LinkAnnotation a in list)
{
// Print the destination URL
Console.WriteLine("Destination: " + (a.Action as Aspose.Pdf.InteractiveFeatures.GoToRemoteAction).File.Name+ "");
}
}
hi,
PdfAction action = annot.Action;if (action is GoToRemoteAction){GoToRemoteAction gotoraction = action as GoToRemoteAction;sLinkDest = gotoraction.File.Name;}
Hi Chenna,
Hi Tilal Ahmad,
Any update on the issue "PDFNEWNET-37981"related to "Invalid Destination path for GotoRemoteAction"?
I really appreciate if I can get early resolution to this issue.
Thanks & Regards
Chenna Basappa C
Hi,
I know you are working on the issue (PDFNEWNET-37981), I am just curious to know any further update on this issue which is reported almost a month back.
I am holding my project time-line for this to be resolved. It would be great if you share any further update on this item.
Thanks & Regards
Chenna Basappa C
Hi Chenna,
Hi Chenna,
private string TruncateString(string s)<o:p></o:p>
{
string result = s;
//find zero character.
int index = s.IndexOf((char)0);
//if zero character present, truncate characters after it.
if (index != -1)
{
result = s.Substring(0, index);
}
return result;
}
[C#]
…<o:p></o:p>
else if (link.Action is GoToRemoteAction)
{
GoToRemoteAction action = (GoToRemoteAction)link.Action;
Console.WriteLine(TruncateString((action as GoToRemoteAction).File.Name));
}
...
The issues you have found earlier (filed as PDFNEWNET-37973) have been fixed in Aspose.Pdf for .NET 10.6.0.
Hi Chenna,
// Load source PDF file containing
hyperlinks<o:p></o:p>
Document document = new Document(input("define.pdf"));
// Traverse through all the page of PDF
foreach (Aspose.Pdf.Page page in document.Pages)
{
// Get the link annotations from particular page
AnnotationSelector selector = new AnnotationSelector(new Aspose.Pdf.InteractiveFeatures.Annotations.LinkAnnotation(page, Aspose.Pdf.Rectangle.Trivial));
page.Accept(selector);
// Create list holding all the links
IList list = selector.Selected;
Console.WriteLine("Number of links = " + list.Count);
// Iterate through invidiaul item inside list
int count = 0;
string name;
string actionType;
foreach (LinkAnnotation a in list)
{
// Print the destination URL
name = null;
actionType = null;
if (a.Action is Aspose.Pdf.InteractiveFeatures.GoToRemoteAction)
{
name = (a.Action as Aspose.Pdf.InteractiveFeatures.GoToRemoteAction).File.Name;
actionType = "GoToRemoteAction";
}
else
if (a.Action is Aspose.Pdf.InteractiveFeatures.LaunchAction)
{
name = (a.Action as Aspose.Pdf.InteractiveFeatures.LaunchAction).File;
actionType = "LaunchAction";
}
if (name != null)
{
int index = name.IndexOf((char)0);
if (index >= 0)
{
name = name.Substring(0, index);
}
Console.WriteLine(actionType + ": #" + count + "
Destination: " + name + "");
count++;
}
}
}