PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

pdf links
http://forum.pdfsharp.de/viewtopic.php?f=2&t=1570
Page 1 of 1

Author:  nagarjunaa [ Sat Mar 05, 2011 1:22 pm ]
Post subject:  pdf links

Hi all I have created Link below is the code

public void AddPdfPage(int idx)
{
page = inputDocument1.Pages[idx];
page = outputDocument.AddPage(page);
gfx = XGraphics.FromPdfPage(page);
}

public void AddLinksFirstPage(string strText, string strPageText, int intLPage, int index, int intSelWidth)
{
font = new XFont("Arial", 11, XFontStyle.Regular | XFontStyle.Underline);
link = gfx.Transformer.WorldToDefaultPage(new XRect(new XPoint(70, 100 + (index * 20)), new XSize(530, 15 * intSelWidth)));
lin = new PdfRectangle(link);

gfx.DrawString(strText, font, XBrushes.Blue, 70, 100 + (index * 20), XStringFormat.TopLeft);
font = new XFont("Arial", 11, XFontStyle.Regular);
gfx.DrawString(strPageText.PadLeft(10), font, XBrushes.Blue, 530, 100 + (index * 20), XStringFormat.TopCenter);

page.AddDocumentLink(lin, intLPage);
}

this call for multiples pages

i hope the problem is at
Elements[Keys.Dest] = new PdfLiteral("[{0} 0 R/XYZ null 0 null 0]", dest.ObjectNumber);

but when kept "XYZ null null 0" with "FITB" working, i need inherit mode.

any feedback will be great.

Thanks
Nagarjuna

Attachments:
File comment: focus to 26 page
Third.JPG
Third.JPG [ 156.36 KiB | Viewed 3898 times ]
File comment: click on index with page focus to 7
Second.JPG
Second.JPG [ 152.78 KiB | Viewed 3898 times ]
File comment: generated pdf
First.JPG
First.JPG [ 150.56 KiB | Viewed 3898 times ]

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/