Created
March 25, 2024 07:35
Render XSL-FO File Format to PDF in C#. The steps to achieve this conversion are elaborated here: https://kb.conholdate.com/total/net/how-to-render-xsl-fo-to-pdf-in-c-sharp/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
//Add reference to Aspose.PDF for .NET API | |
//Use the following namespace to render XSL-FO file format to PDF format | |
using Aspose.Pdf; | |
namespace RenderXSLFOToPDF | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//Set license before rendering XSL-FO file type to PDF file | |
Aspose.Pdf.License AsposePDFLicense = new Aspose.Pdf.License(); | |
AsposePDFLicense.SetLicense(@"c:\asposelicense\license.lic"); | |
//Load XSL-Fo file using XSL Fo load options | |
Document InputXSLFODocument = new Document("InputXSLFODocument.fo", new XslFoLoadOptions()); | |
//Save the PDF file converted from XSL-FO document | |
InputXSLFODocument.Save("OutputPDFConvertedFromXSLFOFile.pdf"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment