Server 2009

XPSToPDF

Example code is for an older version of Server, newer code is available.
<!-- Copyright (c) 2019 ActivePDF, Inc. -->
<!-- ActivePDF Server 2009 -->
<!-- Example generated 09/21/19  -->

<!-- Example uses the .NET DLL which requires -->
<!-- Coldfusion 8 or above -->

<CFSCRIPT>
// Get current path
strPath = ExpandPath(".") & "\";

// Instantiate Object
oSVR = CreateObject(".NET", "APServer.Server", "C:\Program Files\activePDF\Server\bin\APServer.dll");

// XPS to PDF conversion
// Convert XPS file into PDF
intXPSToPDF = oSVR.XPSToPDF(strPath & "XPS.xps", strPath & "XPS.pdf");
if(intXPSToPDF != 0) {
  Error("XPSToPDF", intXPSToPDF);
}

// Release Object
oSVR = 0;

// Process Complete
WriteOutput("Done!");

// Error Handling
Function Error(method, outputCode) {
  WriteOutput("Error in " & method & ": " & outputCode);
}
</CFSCRIPT>

Copyright © 2019 ActivePDF, Inc