Hello,
I have an original pdf file with a "hotlink" url address within the page.
I have imported this page into generator and then i am essentially covering up the "original" url with a white box and then creating a new url with variable data being applied for certain parts of the "new" url.
Issue: Since all I did was to cover-up the original url in the imported PDF my issue is:
#1 Original url is still clickable even when covered
#2 New url is not clickable at all
Example:
Original URL - http://www.somewhere.com
---Covered up
New URL on top -- http://www.somewhere.com/978452
Solutions?:
#1 My new url is clickable and resolves to the value provide to the label?
#2 Turn off hot click when original PDF is created and then overlay with new url, not clickable.
#3 Read original text from the url and then append it programitically?
Number three seems ideal but not sure how to read in this copy block programitically.
Any help or direction to address this issue would be appreciated.
Thanks in advance. If you require further information please advise.
Clickable Links
Re: Clickable Links
Support · Aug 7, 2008Hello,
We are able to add a white rectangle on an existing link and added a new link which is working fine. Please make sure that you are adding the rectangle in correct X, Y position on the existing link element. Can you please send over the code you are using so that we can take a look at it.
If you are using the Merger product to merge the existing PDF document then you can use the MergeOptions class to stop the links from being preserved when merging. You will have to set the PageAnnotations property of the MergeOptions to false.
Thanks,
ceTe Software Support Team.
Re: Clickable Links
Forum member · Aug 7, 2008string sImportPath = Server.MapPath(Request.ApplicationPath) + @"docs\ORIGINAL.pdf";
if (System.IO.File.Exists(sImportPath))
{
document.Title = "test";
//Create new page for document
ceTe.DynamicPDF.Page page_1 = new ceTe.DynamicPDF.Page(PageSize.Letter, PageOrientation.Portrait, 0 );
//Import the existing document path (ie "\docs\") and add to page
page_1.Elements.Add( new ImportedPageArea( sImportPath, 1, 0, 0 ) );
//Add page(s) to document
document.Pages.Add( page_1 );
if(this.ResellerRepID != 0)
{
//Add a white box to cover of url
ceTe.DynamicPDF.PageElements.Rectangle urlcoverbox = new ceTe.DynamicPDF.PageElements.Rectangle(329, 529, 275, 60, 0, RgbColor.White);
page_1.Elements.Add(urlcoverbox);
//Create the Label for the URL
ceTe.DynamicPDF.PageElements.Label url = new ceTe.DynamicPDF.PageElements.Label("", 329, 569, 250, 20, futuraHeavy, 9);
//Assign Url Value
url.Text = "http://www.purchasedge.com/join/" + this.ResellerRepID.ToString() + ".";
url.TextColor = RgbColor.Black;
page_1.Elements.Add(url);
}
document.DrawToWeb( "NEW.pdf" );
Response.End();
}
else
{
//DO SOMETHING
}
Re: Clickable Links
Support · Aug 7, 2008Hello,
In your code you are using the ImportedPageArea to import the existing page and this will not preserve the link page element. So the page will have only the link text but not the link address.
When you add a new link with text, the new link will only work. We are unable to recreate the behavior you are having? Please send over the input, output PDF documents and the code you are using for this to our [^a|mailto:support@cete.com|Support Team^] so that they can look into it further.
Thanks,
ceTe Software Support Team.
Re: Clickable Links
Forum member · May 1, 2013The solution is to use the ImportedPage class instead. The code is slightly different, but it will preserve links.
For example:
var importedPage = new ImportedPage(docPath, pageNumber);
document.Pages.Add(importedPage);