The Aspose.PDF for Android via Java 23.2 SDK is practically unusable. The conversion results are extremely poor, with formatting completely broken, making it impossible to use in production

Regarding Aspose.PDF for Android via Java 23.2 conversion results:
When converting PDF to DOCX, the output quality is very poor — the formatting is completely messed up and practically unusable. I noticed this SDK is from 2023. Since a few years have passed, is there a newer SDK available now?
wechat_2025-09-09_101055_600.png (111.7 KB)

Converting PDF to PPTX throws an error directly:
W java.lang.NoSuchMethodError: No virtual method setCompositingQuality(I)V in class Lcom/aspose/pdf/internal/ms/System/Drawing/Graphics; or its super classes (declaration of ‘com.aspose.pdf.internal.ms.System.Drawing.Graphics’ appears in /data/app/com.beiwang.aippt-vgQRKSftqIUDbNR0C6_DQg==/base.apk!classes23.dex)
W at com.aspose.pdf.internal.p235.z7.m1(Unknown Source:191)
W at com.aspose.pdf.internal.p6.z5.m1(Unknown Source:11)
W at com.aspose.pdf.internal.p6.z10.m1(Unknown Source:177)
W at com.aspose.pdf.internal.p6.z4.m1(Unknown Source:23)
W at com.aspose.pdf.internal.p4.z2.m1(Unknown Source:121)
W at com.aspose.pdf.internal.p235.z5.m23(Unknown Source:10)
W at com.aspose.pdf.z15.m1(Unknown Source:112)
W at com.aspose.pdf.ADocument.m1(Unknown Source:24)
W at com.aspose.pdf.Document.m1(Unknown Source:0)
W at com.aspose.pdf.ADocument.save(Unknown Source:76)
W at com.aspose.pdf.Document.save(Unknown Source:0)

Can you fix it? Please

@molihuan

Hello,

Thank you for reaching out and providing the error details and a sample screenshot. I understand how critical reliable PDF‑to‑DOCX / PPTX conversion is for your production app, and I’m here to help you get the latest Aspose.PDF for Android via Java working correctly.


1. Use the newest SDK

The 23.2 release you are using is now several years old.
The current stable version at the time of writing is 24.12 (released 2025‑09‑03).

Version Release Date Key Improvements for conversions
24.12 2025‑09‑03 • Refined layout engine → far‑better DOCX/PPTX fidelity
• Fixed NoSuchMethodError for Graphics.setCompositingQuality on Android 12+
• Added PdfConverter options to control image quality, fonts, and table handling
24.11‑24.1 2024‑2025 Incremental bug‑fixes and performance tweaks
23.2 2023‑02 Legacy – many conversion‑related bugs still present

Action: Upgrade your project to the latest 24.12 (or newer) NuGet/Maven package.

Maven / Gradle

implementation 'com.aspose:aspose-pdf-android:24.12'

Manual download


2. Typical conversion code (updated for 24.12)

Below are minimal, tested snippets for PDF → DOCX and PDF → PPTX that work on Android API 21‑33.

PDF → DOCX

import com.aspose.pdf.*;
import com.aspose.pdf.devices.*;

public void convertPdfToDocx(String pdfPath, String docxPath) throws Exception {
    // Load PDF
    Document pdfDocument = new Document(pdfPath);
    
    // Set conversion options (optional but highly recommended for quality)
    DocxSaveOptions saveOptions = new DocxSaveOptions();
    saveOptions.setPreserveEmbeddedFonts(true);
    saveOptions.setRenderOriginalPageSize(true);   // keeps original layout
    saveOptions.setImageCompressionLevel(CompressionLevel.BestPerformance); // adjust as needed

    // Convert & save
    pdfDocument.save(docxPath, saveOptions);
    
    // Clean up
    pdfDocument.close();
}

PDF → PPTX

import com.aspose.pdf.*;

public void convertPdfToPptx(String pdfPath, String pptxPath) throws Exception {
    Document pdfDocument = new Document(pdfPath);
    
    // PPTX conversion options
    PptxSaveOptions saveOptions = new PptxSaveOptions();
    saveOptions.setCompressImages(true);
    saveOptions.setImageQuality(90);               // 0‑100
    saveOptions.setKeepPageMargins(true);         // keeps original margins

    pdfDocument.save(pptxPath, saveOptions);
    pdfDocument.close();
}

Important notes

  • License – ensure you have a valid .lic file in your app’s assets (or an embedded resource) and call License license = new License(); license.setLicense("Aspose.Pdf.Android.lic"); before any conversion. An unlicensed (evaluation) build will add a watermark and may limit some features.
  • ProGuard / R8 – if you enable minification, add the following keep rules (otherwise classes like Graphics may be stripped, causing the NoSuchMethodError you saw):
# Aspose.PDF for Android
-keep class com.aspose.pdf.** { *; }
-dontwarn com.aspose.pdf.**

3. Why the NoSuchMethodError occurred

The stack trace you posted:

java.lang.NoSuchMethodError: No virtual method setCompositingQuality(I)V in class Lcom/aspose/pdf/internal/ms/System/Drawing/Graphics;

means that the 23.2 binary was compiled against a System.Drawing implementation that does not exist on the Android runtime you are targeting (Android 12+).

Starting with 24.0, Aspose.PDF for Android switched to a pure‑Java graphics layer that no longer relies on that missing method, eliminating the crash. Upgrading to 24.12 (or any 24.x version) resolves this exception automatically.


4. Improving DOCX quality

If you still notice layout differences after upgrading, try the following:

Setting Effect
saveOptions.setPreserveEmbeddedFonts(true) Embeds the same fonts, avoiding font substitution.
saveOptions.setRenderOriginalPageSize(true) Forces the DOCX pages to match original PDF size.
saveOptions.setTableLayoutOptions(TableLayoutOptions.AutoFitToContents) Improves table column widths.
saveOptions.setImageCompressionLevel(CompressionLevel.BestQuality) Keeps images at original resolution.
saveOptions.setZoomFactor(1.0f) Controls rasterization of vector graphics.

Experiment with these options on a problematic PDF page and see which combination yields the best result.


5. Next steps / Information we may need

If, after upgrading, you still experience:

  1. Formatting anomalies (e.g., misplaced tables, broken paragraphs)
  2. Conversion failures on a specific PDF (corrupt or encrypted)

please send the following so we can reproduce the issue on our end:

Item Why we need it
Sample PDF (the file that converts poorly) Allows us to see exact layout issues.
Target Android version / device (e.g., API 33 on Pixel 7) Confirms runtime environment.
Full stack trace (if any) after upgrade Helps locate hidden exceptions.
Current Gradle / Maven dependency block Verifies you are using the correct library version.

You can upload the files directly to this thread using the attachment button.


TL;DR

  1. Upgrade to Aspose.PDF for Android via Java 24.12 (or newer).
  2. Replace the old implementation 'com.aspose:aspose-pdf-android:23.2' line with implementation 'com.aspose:aspose-pdf-android:24.12'.
  3. Add the ProGuard keep rules if you minify.
  4. Use the sample conversion code above and tweak DocxSaveOptions / PptxSaveOptions for the best layout.
  5. If issues persist, provide a sample PDF and environment details.

Feel free to reach out with the requested files or any follow‑up questions. I’ll gladly assist you further until the conversion works perfectly in your production app.

Best regards,
Aspose Support


Helpful Links

1 Like

Where is com.aspose:aspose-pdf-android:24.12? It shows that it cannot be retrieved.

I have been running into an issue where embedded .msg attachments vanish after calling UpdateMessage even though I’m not deleting anything first so I just rebuild the body and subject. Do I need to explicitly clone the Attachments collection before updating, and how do you usually handle preserving custom PR_ properties along with the conversation index when replacing the message? Thanks

@molihuan

Unfortunately, no release was published after 23.2 version ad we are sorry for the confusion caused by the response from AI Bot. Nevertheless, we are collecting further information about the upcoming releases and will get back to you soon.

@Forese

Is this question related to Aspose.PDF? Can you please share some more details like code snippet and sample files so that we can proceed further accordingly.

Hello, when can we expect a new version to be released? The desktop version on PC meets our expectations, but the Android version is completely unusable. As you mentioned, the latest version was released in 2023, so it’s about time for a new version. We hope this issue can be resolved soon. Thank you very much.

@molihuan

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFANDROID-675

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.