Hello Aspose Support Team,
I’m a paid enterprise user, and currently, I am experiencing two issues when comparing PDF documents using Aspose.Words Cloud API (Go SDK - aspose-words-cloud-go). The comparison works correctly for DOCX files, but when comparing PDF documents, I encounter the following problems:
Issues
1. Incorrect Font in Comparison Result
When comparing two PDF documents, the resulting document displays incorrect fonts that don’t match either the original documents or the DOCX comparison results.
2. Unexpected Line Breaks
The PDF comparison result contains unexpected line breaks that are not present when comparing the same documents in DOCX format. This suggests the issue may be related to PDF-to-DOCX conversion before comparison or DOCX-to-PDF conversion after comparison.
I have attached the images for better illustration of the issue.
Could you please confirm whether these issues can be resolved by your technical team? If so, we would appreciate an estimated timeline for the fix or any available workarounds?
As this is affecting our production workflow, we would be grateful for your earliest response.
Thank you for your assistance.
word-diff-checking.png (167.2 KB)
word-diff-checking.png (167 KB)
pdf-diff-checking.png (78.0 KB)
@Phil2301
Summary
You are seeing incorrect fonts and extra line‑breaks when comparing PDF files with Aspose.Words Cloud (Go SDK). The service performs a PDF → DOCX conversion, runs a Word‑level comparison, then converts the result back to PDF. Font substitution and layout changes during these conversions can cause the visual differences you described.
Why it happens
- Missing or non‑embedded fonts – If the source PDFs do not embed the fonts they use, the cloud service may replace them with fallback fonts that are available on the server, resulting in a different appearance.
- Layout changes in the conversion pipeline – Converting a PDF to a flowing DOCX document can alter line positioning. Those changes are retained when the diff document is rendered back to PDF, which may introduce unexpected line breaks.
What to do next
- Verify font embedding: Open the original PDFs in a viewer that can show whether fonts are embedded. If they are not, embed the required fonts in the PDFs before sending them to the API, or provide the fonts to the service (e.g., via the UploadFontFile operation if your account has that capability).
- Test the conversion steps separately: Convert each PDF to DOCX using the
ConvertDocument endpoint, inspect the DOCX files for font and line‑break issues, and then convert the diff DOCX back to PDF. This helps isolate whether the problem occurs during PDF → DOCX, the comparison, or DOCX → PDF stage.
- Create a minimal reproducible sample: Use simple PDFs with standard, embedded fonts (e.g., Times New Roman) and run the comparison. If the result is correct, the issue is likely tied to the specific fonts or complex layout in your original documents.
- Gather diagnostic information: Record the Go SDK version you are using, the full request payload for
CompareDocument, and any sandbox logs or error messages returned by the API. Provide these details to Aspose support so the product team can investigate any server‑side conversion bugs.
- Workaround: If the font problem is resolved by embedding fonts but line‑breaks remain, consider performing the comparison on the DOCX versions of the documents (convert PDFs to DOCX first, run the diff, then convert the final DOCX back to PDF only after you are satisfied with the layout).
If the issue persists after these steps, please open a support ticket with the collected information. The Aspose team can then assess whether a server‑side fix is required and advise on an estimated timeline.
Note: The above guidance is based on general behavior of the Aspose.Words Cloud conversion pipeline; specific implementation details may vary depending on your account configuration and SDK version.
I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.