using XDocEnd; // Create a new PDF document var document = new PDFDocument(); // Add a page to the document var page = document.AddPage(); // Add some text to the page var text = new Text("Hello, World!", new Font("Arial", 12)); page.Elements.Add(text); // Save the document to disk document.SaveAs("hello.pdf");
using XDocEnd; // Load the Word document var document = new WordDocument("input.docx"); // Convert the document to PDF document.SaveAs("output.pdf", DocumentFormat.PDF);This code loads a Word document using XDocEnd and then converts it to PDF format. It saves the converted document to disk. In conclusion, XDocEnd is a C# package library that provides APIs to work with various document formats. It allows you to create, edit, and convert documents programmatically. The code examples above illustrate how easy it is to use XDocEnd to create a PDF document and convert a Word document to PDF.