However, when a Word document contains review markups or comments, these elements are also included in the resulting PDF. Since manually removing comments and review markups before conversion can be cumbersome for some documents, we would like to know if there is an API option to exclude these elements from the output PDF.
Questions:
Is there a way to exclude review markups and comments from the PDF when using the API?
If there are parameters or options available to control this behavior, please provide details.
Are there any recommended workarounds to prevent comments and review markups from appearing in the final PDF output?
To exclude review markups and comments from the PDF output when converting Word documents using the Aspose API, you currently have a couple of options:
Remove Comments Before Conversion: One straightforward approach is to remove comments from the Word document before performing the conversion. You can use the API to delete comments programmatically. This can be done using the DeleteComments method available in the Aspose.Words API. This way, you can ensure that the comments do not appear in the final PDF output.
Here’s a brief example of how you might implement this in your code:
// Assuming you have already set up your Aspose.Words API client
var deleteCommentsRequest = new DeleteCommentsRequest("documentName.docx");
await wordsApi.DeleteComments(deleteCommentsRequest);
Use Save Options: While the current API version does not provide a direct parameter to exclude comments during the conversion process, you can explore the PdfSaveOptionsData class to see if there are any additional options that might help in your specific case. However, as of now, the most reliable method is to remove the comments beforehand.
Workaround: If you frequently need to convert documents without comments, consider creating a utility function that handles the removal of comments and then performs the conversion in one go. This can streamline your workflow and reduce manual effort.
For more detailed information on how to manage comments and perform conversions, you can refer to the Aspose documentation or the API reference.
If you have any further questions or need additional assistance, feel free to ask!