Is the API support for PUB to PDF/A

Hi,
I am using Aspose.Total license for java.
Is there API support to convert Microsoft Publisher to PDFA? If there is, please provide if any example code.

Regards
Kalam

@kalaza

Yes, the Aspose.PUB API for Java supports converting Microsoft Publisher (.pub) files to PDF format. However, the documentation does not explicitly mention support for converting to PDF/A format.

Here is a simple example of how to convert a .pub file to PDF using Aspose.PUB for Java:

import com.aspose.pub.PubDocument;
import com.aspose.pub.PubFileFormat;

public class PubToPdfExample {
    public static void main(String[] args) {
        // Load the PUB file
        PubDocument document = new PubDocument("input.pub");

        // Save the document as PDF
        document.save("output.pdf", PubFileFormat.PDF);
    }
}

In this example, replace "input.pub" with the path to your Microsoft Publisher file, and "output.pdf" will be the resulting PDF file.

For PDF/A conversion, you may need to check if additional settings or libraries are required, as the current documentation does not provide specific details on this feature. You can explore the Aspose.PUB documentation for more information and updates regarding this functionality.

If you have further questions or need assistance, feel free to ask!

Sources:
[1]: Aspose.PUB Product family | Documentation

Hi,
Thanks for the quick reply.
Does this mean that you don’t know if the Apose.PUB for java has PDF/A conversion support or not?

I have already checked those materials you have referenced here. Nothing found.

Anything concrete?

@kalaza

We are afraid that no direct PDF/A conversion is supported yet. You need to use Aspose.PDF to convert resultant file into PDF/A.

Thanks, I had the same understanding and aready did that same as you have mentioned.

Hi again,
I am using the example code like here: Aspose.PUB-for-Java/Examples/src/main/java/com/aspose/pub/conversion/ConvertPUBtoPDF.java at master · aspose-pub/Aspose.PUB-for-Java · GitHub

And the christmas.pub file from the example. There is some font related error. Do you get the same error?

class com.aspose.pub.exceptions.ConvertException: Can't create PDF font with name = JuneBug --> PDF: Font JuneBug was not found\n" +
    'com.aspose.pub.internal.l40y.lf.lI(Unknown Source)\n' +
    'com.aspose.pub.lc.lI(Unknown Source)\n' +
    'com.aspose.pub.lc.lI(Unknown Source)\n' +
    'com.aspose.pub.lc.lI(Unknown Source)\n' +
    'com.aspose.pub.lc.lI(Unknown Source)\n' +
    'com.aspose.pub.lc.convertToPdf(Unknown Source)\n' +

Using halloween-flyer.pub file different font error:

class com.aspose.pub.exceptions.ConvertException: Can't create PDF font with name = skullphabet --> PDF: Font skullphabet was not found\n" +
    'com.aspose.pub.internal.l40y.lf.lI(Unknown Source)\n' +
    'com.aspose.pub.lc.lI(Unknown Source)\n' +
    'com.aspose.pub.lc.lI(Unknown Source)\n' +
    'com.aspose.pub.lc.lI(Unknown Source)\n' +
    'com.aspose.pub.lc.lI(Unknown Source)\n' +
    'com.aspose.pub.lc.convertToPdf(Unknown Source)\n' +

Check the attachment:
image.png (52.0 KB)

Java version:

java -version
openjdk version "11.0.24" 2024-07-16
OpenJDK Runtime Environment (build 11.0.24+8-post-Ubuntu-1ubuntu322.04)
OpenJDK 64-Bit Server VM (build 11.0.24+8-post-Ubuntu-1ubuntu322.04, mixed mode, sharing)

My Java code for pub to pdf conversion is

IPubParser parser = PubFactory.createParser(args.inputFilePath);
// Save as PDF file format
Document doc = parser.parse();
PubFactory.createPdfConverter().convertToPdf(doc, args.outputFilePath);

However, in your above example code PubDocument even could not found in the aspose-pub jar.

@kalaza

We are working on this case and will get back to you shortly.

@kalaza

We tested using 22.8 version of the API in our environment while using the code snippet in the screenshot and we could not replicate the issue that you have mentioned.
image.png (18.4 KB)

Attached is the output PDF that we have obtained.
result_out.pdf (3.5 MB)

Could you please make sure to refresh the Maven Cache and make sure that all indices are up to date.