Word to PDF Element |
WordToPdfElement draws a Word document - .docx, .doc, RTF and the other formats of the Word to PDF converter - at a position on a PDF page, like HTML to PDF Converter Element does for HTML. A document longer than the page continues on the following pages.
using ExpertPdf.Anywhere.PdfDocument; Document document = new Document(); PdfPage page = document.AddPage(); PdfFont font = document.AddFont(StdFontBaseFamily.HelveticaBold); page.AddElement(new TextElement(0, 0, "Quarterly report", font)); // the Word document below the title, the full width of the page, as long as it // needs to be (it continues on new pages) WordToPdfElement word = new WordToPdfElement(0, 30, "report.docx"); page.AddElement(word); document.Save("report.pdf"); document.Close();
The constructors take the position, optionally a width and a height, and a file path or a stream. With a height, only that much of the document is drawn.
Format, Password, PageRanges, Bookmarks: as on the Word to PDF converter.
LiveUrlsEnabled and InternalLinksEnabled: keep the links of the document.
PdfPagesRectangles: after the element is added, where it was drawn on each page.
A Word document can also be the header or footer of a Word to PDF conversion: set WordToPdfArea on the converter's header or footer options.