| ||
Introducing SharpPlot Your First Chart Recent Updates Sample Charts Tutorials General Tutorials Chart Tutorials SharpPlot Class Properties Structures Enumerations Style examples Glossaries Active Charts VectorMath Class DBUtil Class Get SharpPlot Download SharpPlot Buying SharpPlot SharpPlot Support Upgrading from GraPL Release notes |
Reference > Methods > AddBookmark Method SharpPlot.AddBookmark MethodCreates a bookmark at this point in the output stream. This will be used in PDF output to create an entry in the outline for the document. Overloads
Examplesp.Reset(590,835); // Paper size sp.AddBookmark("January 2006",0,true); DescriptionMulti-page collections of charts may be bookmarked with easily recognised names which can be organised into a tree structure to be shown by the Acrobat Reader as ‘Outlines’. It is also possible to create entries in the outline tree which jump to external resources, typically webpages or other PDFs. The simple form of the command is ... sp.AddBookmark("Sales analysis"); The bookmark will be placed on the next chart to be generated – you may call Making an indented outline for Acrobat ReaderThe outline information is included in the PDF file generated using sp.AddBookmark("'Sales analysis",0); sp.AddBookmark("Europe",1); sp.DrawBarChart(arr_europe); sp.NewPage(); sp.AddBookmark("Asia",1) sp.DrawBarChart(arr_asia); ... and so on. This structure will then appear in the Acrobat Viewer outline bar to the left of the document. By default, sections will be closed on opening the document – you can force the Acrobat Viewer to open a section automatically by appending true as the third parameter to the bookmark call: sp.AddBookmark("Profit and Loss",0,true); sp.AddBookmark("Income breakdown",1,true); sp.AddBookmark("Consulting",2); Linking to webpages or other PDFsYou can add a link to an external resource by including a 4th element in the call, for example: sp.AddBookmark("Home page",0,true,"http://www.grapl.com"); This will allow the user to click on the outline entry and automatically open a web-browser at the page you give. To have Acrobat Reader load another PDF, just use a filename here in place of the url. See also ... |