Convert cmx to pdf

Convert cmx to pdf

Using Aspose.Imaging we can convert single paged or multi-page cmx image to pdf.

The following code snippet shows you how to convert cmx to pdf.

import com.aspose.imaging.*;
import com.aspose.imaging.imageoptions.PdfOptions;
import com.aspose.imaging.imageoptions.VectorRasterizationOptions;
try (com.aspose.imaging.fileformats.cmx.CmxImage image =
(com.aspose.imaging.fileformats.cmx.CmxImage)Image.load("input.cmx"))
{
com.aspose.imaging.imageoptions.PdfOptions options = new PdfOptions();
options.setPdfDocumentInfo(new com.aspose.imaging.fileformats.pdf.PdfDocumentInfo());
// Set rasterization options for fileformat
VectorRasterizationOptions rasterizationOptions = (VectorRasterizationOptions) image.getDefaultOptions(new Object[]{Color.getWhite(), image.getWidth(), image.getHeight()});
options.setVectorRasterizationOptions(rasterizationOptions);
rasterizationOptions.setTextRenderingHint(TextRenderingHint.SingleBitPerPixel);
rasterizationOptions.setSmoothingMode(SmoothingMode.None);
image.save("output.pdf", options);
}