Skip to content

Instantly share code, notes, and snippets.

@blog-aspose-cloud
Last active February 22, 2024 02:38
Convert XPS to PDF online

Convert XPS to PDF in C# .NET


Master document transformation with our comprehensive guide on converting XPS files to PDF format using Aspose.PDF Cloud SDK for .NET. Explore step-by-step instructions, best practices, and coding examples to streamline your workflow and elevate your document management process.



For more details, please visit Develop XPS to PDF Converter in C# .NET.

xps to pdf

Important Links

Product Page | Docs | Live Demo | API Reference | Code Samples | Source Code | New Releases | Blog | Free Support | Free Trial

How to convert XPS to PDF with .NET REST API
// For more examples, https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-dotnet/tree/master/Examples
// Get client credentials from https://dashboard.aspose.cloud/
string clientSecret = "c71cfe618cc6c0944f8f96bdef9813ac";
string clientID = "163c02a1-fcaa-4f79-be54-33012487e783";
// create an instance of PdfApi
PdfApi pdfApi = new PdfApi(clientSecret, clientID);
// name of input JPG image
String inputFile = "Simple.xps";
// load source XPS from local drive
using (var stream = System.IO.File.OpenRead(inputFile))
{
// upload XPS file to cloud storage
pdfApi.UploadFile("input.xps", stream);
// call the API to convert XPS file to PDF format
var resltant = pdfApi.PutXpsInStorageToPdf(resultantPDF,"input.xps");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment