Hello,
Is it possible not to update fields during DOC to PDF conversion?
I have a Word document that has a “FileName” field with full path included. When I convert it to PDF Aspose updates the field instead of using the value stored in the document. Please see the attached sample document and the test code.
The sample file has a stored field value “R:\tmp\FileName field test.doc”, while the result PDF contains a text with the current location.
String testFile = "r:\datasets\docs\Filename field\FileName field test.doc";
Document document = new Document(testFile);
Iterable fields = (Iterable)document.getChildNodes(NodeType.FIELD_START, true);
for (FieldStart fs : fields)
{
System.out.println("Field: " + fs.getField().getResult());
}
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setSaveFormat(SaveFormat.PDF);
String resultFile = testFile + ".pdf";
document.save(resultFile, saveOptions);