trichview.support.thirdparty
Page number of llPDF outline (bookmark) |
Author |
Message |
Chris Goodger |
Posted: 03/22/2004 6:14:11 I am using llPDF to create a PDF from a TRichView control. I want to be able to create an outline (bookmark) for each checkpoint in my document. In order to do this, you need to know what page the checkpoint is on, and how far down the page it is. I use a report helper (called rvrhPDF) to create the PDF as follows. Where I have xxx, and yyy, I need to know the page number and vertical offset for the checkpoint. rvrhPDF.Init(pdfReport.Canvas, DocWidth); while rvrhPDF.FormatNextPage(DocHeight) do begin end; RootOutline := pdfReport.Outlines.Add(nil, 'Report', nil); for i := 0 to Pred(rvrhPDF.PagesCount) do begin DisplayMessage(MessageInformation, Format('Collecting PDF pages (%d of %d)... ', [i, rvrhPDF.PagesCount])); if i>0 then begin pdfReport.NewPage; pdfReport.Page[i].Size := pdfReport.Page[0].Size; pdfReport.Page[i].Orientation := pdfReport.Page[0].Orientation; end; fBookmarks.Add(i, 0, 'Page ' + IntToStr(i)); rvrhPDF.DrawPageAt(LeftMargin, TopMargin, i+1, pdfReport.Canvas, False, DocHeight); end; CheckpointData := rvrhPDF.RichView.GetFirstCheckpoint; while (CheckpointData <> nil) do begin rvrhPDF.RichView.GetCheckpointInfo(CheckpointData, Tag, Name, RaiseEvent); fBookmarks.Add(xxx, yyy, Name); CheckpointData := rvrhPDF.RichView.GetNextCheckpoint(CheckpointData); end; Can anyone help me with this. Thanks, Chris Goodger |
Powered by ABC Amber Outlook Express Converter