We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

[Error loading object: misaligned object] when opening PDF by PDF-XChange

Hello, there is an error [Error loading object: misaligned object] prompted when open a PDF by PDF-XChange. The PDF file was encrypted by PdfFileSecurity.encryptFile(). Before the encryption, it can be opened normally without the error prompt. So, I doubt that there is something went wrong after the encryption.

The library we used is [aspose-pdf-kit-4.2.0.jar] and this library required a license.

Here is the snip code:
try {
java.io.InputStream in = getClass().getResourceAsStream(“Aspose.Total.Java.lic”);
com.aspose.pdf.kit.License license = new com.aspose.pdf.kit.License();

String newFilePath = "";
PdfFileSecurity fileSecurity = new PdfFileSecurity(filePath, newFilePath);
fileSecurity.encryptFile(pwd, pwd, PdfPrivilege.AllowAll, false)

} catch (Exception e) {
System.err.println("Aspose PDF Error: "+e.toString());

Btw, understand that the library may be out of date, is there any cost if we would like to update it.

Thank you.


Thank you for contacting support.

Please note that support is provided based on latest available versions so we are afraid any bug fixes or feature enhancements may not be incorporated in previous versions. Therefore, we would like to request you to please upgrade to Aspose.PDF for Java 19.1. In case you face any problem with latest version then please share respective data so that we may assist you accordingly.

Moreover, you may contact our sales team or create a post over Purchase Forums for any purchase related information.

Thank you @Farhan.Raza.