Exemplo n.º 1
0
        static void Main(string[] args)
        {
            RichEditDocumentServer server = new RichEditDocumentServer();
            // Create an instance of the class implementing the IPdfLinkUpdater interface.
            LinkUpdater linkUpdater = new LinkUpdater();

            server.AddService(typeof(ILinkUpdater), linkUpdater);
            RegisterAnchor(server.Document, linkUpdater, "1.html");
            server.Document.AppendText(new string(Characters.PageBreak, 1));
            RegisterAnchor(server.Document, linkUpdater, "2.html");
            // Export the document to PDF and open the resultant file.
            string resultPath = "..\\..\\result.pdf";

            using (Stream stream = File.Create(resultPath))
                server.ExportToPdf(stream);
            Process.Start(Path.GetFullPath(resultPath));
        }