PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Sep 23, 2018 7:41 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: AddWebLink problem
PostPosted: Tue Feb 10, 2009 9:25 pm 
Offline

Joined: Tue Feb 10, 2009 9:23 pm
Posts: 4
Hi All,

I'm trying to use addweblink.

It add's a link but it links to something like:

%97%D5h%A6

Cheers,
Tim


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 11, 2009 8:51 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2862
Location: Cologne, Germany
Our web links work.

Dare to show us some of your code?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 11, 2009 9:35 am 
Offline

Joined: Tue Feb 10, 2009 9:23 pm
Posts: 4
Sure,

Code:
PdfDocument document = new PdfDocument();


PdfPage page = document.AddPage();
XGraphics gfx = XGraphics.FromPdfPage(page);
XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always);

//other things going on here ... drawing on the gfx

PdfSharp.Drawing.XRect rectt = gfx.Transformer.WorldToDefaultPage(new PdfSharp.Drawing.XRect(Convert.ToInt32(item.Attributes["X1"].Value),
                                height Convert.ToInt32(item.Attributes["Y1"].Value),
                               Convert.ToInt32(item.Attributes["X2"].Value),
                               height  Convert.ToInt32(item.Attributes["Y2"].Value)));

                        PdfSharp.Pdf.PdfRectangle rc = new PdfSharp.Pdf.PdfRectangle(rectt);
                        page.AddWebLink(rc, "http://www.google.com");

PdfSecuritySettings securitySettings = document.SecuritySettings;

securitySettings.PermitAccessibilityExtractContent = PermitExtractContent;
            securitySettings.PermitAnnotations = false;
            securitySettings.PermitAssembleDocument = false;
            securitySettings.PermitExtractContent = PermitExtractContent;
            securitySettings.PermitFormsFill = true;
            securitySettings.PermitFullQualityPrint = PermitPrint;
            securitySettings.PermitModifyDocument = false;
            securitySettings.PermitPrint = PermitPrint;


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 11, 2009 7:44 pm 
Offline

Joined: Tue Feb 10, 2009 9:23 pm
Posts: 4
it looks like this occurs when I set the securitySettings.OwnerPassword.

securitySettings.OwnerPassword = "owner";

Any tips how I need to encode the url ?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Feb 12, 2009 9:00 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2862
Location: Cologne, Germany
timgeyssens wrote:
it looks like this occurs when I set the securitySettings.OwnerPassword.

I think you found a bug.

If the URL needs to be encrypted then PDFsharp should do it automatically.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Feb 12, 2009 12:12 pm 
Offline

Joined: Tue Feb 10, 2009 9:23 pm
Posts: 4
ok thanks, any idea if / when this could be resolved ?

Please let me know.

Cheers,
Tim


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group