Aspose.PSD Illustrator (.ai) to PDFA converter with Java

Hi,
Is it possible to produce PDFA from *.ai with the Aspose.PSD Java library?

Other modules has the support with the PdfSaveOptions but in PSD API documentation I could not find with the PdfOptions.

If there is any possibility, could you provide the example?

Regards
Kalam Azad

@kalaza please check the following articles:

public static void convertAIToPDF() {
    String sourceFile = "raster.ai";
    String outputFile = "output.pdf";

    try (Image image = Image.load(sourceFile)) {
        image.save(outputFile, new PdfOptions());
    } catch (Exception e) {
        e.printStackTrace();
    }
}

public static void main(String[] args) {
    convertAIToPDF();
}

Hi thanks. I have checked those references you have posted here.

We are using Aspose.total paid license.

My question is specific about PDFA and I know already PDF is possible from .ai files

Could you answer very specific is it possible ai to pdfa?

If you say yes then please provide the specific code examples.

Thanks and regards.

@kalaza please check the following code. I’ve additionallly checked metadata of output document. PDF/A Tags are in place, but please check it additionally, Aspose.PSD not specialized in PDF formats, this is rare request.

        string sourceFile = "patternstokOnePage.ai";
        string outputFile ="output_raw.pdf";

		var pdfOptions = new PdfOptions();
		pdfOptions.PdfCoreOptions = new PdfCoreOptions();
		pdfOptions.PdfCoreOptions.PdfCompliance = PdfComplianceVersion.PdfA1a;

        using (var aiImage = (AiImage)Image.Load(sourceFile))
        {
            aiImage.Save(outputFile, pdfOptions);
        }

Thnaks and is this Java example?

Please check Java sample:

    String sourceFile = "patternstokOnePage.ai";
    String outputFile ="output_raw.pdf";

    PdfOptions pdfOptions = new PdfOptions();
    PdfCoreOptions coreOpt = new PdfCoreOptions();
    coreOpt.setPdfCompliance(PdfComplianceVersion.PdfA1a);

    pdfOptions.setPdfCoreOptions(coreOpt);
    AiImage aiImage = null;
    try
    {
        aiImage = (AiImage)Image.load(sourceFile))
        aiImage.save(outputFile, pdfOptions);

    } finally {
        if (aiImage != null) {
            aiImage.dispose();
        }
    }