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

Free Support Forum - aspose.com

Revision details PDF compare

Hello I notice some problem with default save compared document to PDF.
It looks like PDF always export as “All markup” (compared to word). That produce some “first look” inconsistency like that:

To reproduce this you can use following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("paragraph1");
builder.writeln("paragraph2");

Document doc1 = new Document();
DocumentBuilder builder1 = new DocumentBuilder(doc1);
builder1.writeln("paragraph1 paragraph2");

doc.compare(doc1, "sd", new Date());
doc.save("a.docx");
doc.save("a.pdf");

Is there any option to control how PDF is generated?

@ANDREA.FARRIS Actually, revision appearance in MS Word is configured in MS Word not in the document. On my side, for example, MS Word is configured to show revisions in balloons. You can control how Aspose.Words renders revisions in PDF using RevisionOptions. For example see the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("paragraph1");
builder.writeln("paragraph2");

Document doc1 = new Document();
DocumentBuilder builder1 = new DocumentBuilder(doc1);
builder1.writeln("paragraph1 paragraph2");

doc.compare(doc1, "sd", new Date());

doc.getLayoutOptions().getRevisionOptions().setShowInBalloons(ShowInBalloons.FORMAT_AND_DELETE);

doc.save("C:\\Temp\\a.docx");
doc.save("C:\\Temp\\a.pdf");

a.pdf (29.9 KB)