<!-- Copyright (c) 2021 ActivePDF, Inc. --> <!-- ActivePDF Server 2013 --> <!-- Example generated 04/15/21 --> <!-- 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.Net35.dll"); // Set the quality options for the created PDF // For custom settings to take effect set the configuration to custom oSVR.Set_PredefinedSetting(ADK.PostScript.PredefinedConfiguration.Custom); // Specifies if ASCII85 encoding should be applied to binary streams oSVR.Set_ASCIIEncode(true); // Automatically control the page orientation based on text flow oSVR.Set_AutoRotate(true); // Specifies if CMYK colors should be converted to RGB oSVR.Set_ConvertCMYKToRGB(true); // Set the DPI for the created PDF oSVR.Set_Resolution(300.0); // Set whether existing halftone settings should be preserved oSVR.Set_PreserveHalftone(ADK.PostScript.PreserveSettingOption.Preserve); // Set whether existing overprint settings should be preserved oSVR.Set_PreserveOverprint(ADK.PostScript.PreserveSettingOption.Preserve); // Set how transfer functions from the input file are handled oSVR.Set_PreserveTransferFunction(ADK.PostScript.PreserveTransferSettings.Preserve); // Set whether the UCRandBGInfo, from the input file, should be preserved oSVR.Set_UCRandBGInfo(ADK.PostScript.PreserveSettingOption.Preserve); // Color Image Quality Settings oSVR.Set_ColorImageDownsampleThreshold(1); oSVR.Set_ColorImageDownsampleType(ADK.PostScript.Images.DownsampleOption.None); oSVR.Set_ColorImageFilter(ADK.PostScript.Images.CompressionOption.FlateEncode); oSVR.Set_ColorImageResolution(72); // Gray Image Quality Settings oSVR.Set_GrayImageDownsampleThreshold(1); oSVR.Set_GrayImageDownsampleType(ADK.PostScript.Images.DownsampleOption.None); oSVR.Set_GrayImageFilter(ADK.PostScript.Images.CompressionOption.FlateEncode); oSVR.Set_GrayImageResolution(72); // Monochrome Image Quality Settings oSVR.Set_MonoImageDownsampleThreshold(1); oSVR.Set_MonoImageDownsampleType(ADK.PostScript.Images.DownsampleOption.None); oSVR.Set_MonoImageFilter(ADK.PostScript.Images.MonochromeCompression.FlateEncode); oSVR.Set_MonoImageResolution(72); // Convert the PostScript file into PDF results = oSVR.ConvertPSToPDF(strPath & "PS.ps", strPath & "quality.pdf"); if(results.Get_ServerStatus() != "Success") { Error("ConvertPSToPDF", results, results.Get_ServerStatus()); } // Release Object oSVR = 0; // Process Complete WriteOutput("Done!"); // Error Handling Function Error(method, oResults, errorStatus) { WriteOutput("Error with " & method & ": <br/>" & errorStatus & "<br/>" & oResults.Get_details()); } </CFSCRIPT>