About converting Word files with comment/review markup to PDF

Currently, we are using the following API to convert Word documents to PDF:

time curl -s -w "%{http_code}" -o "${PDF_OUTPUT}" \
  "https://api.aspose.cloud/v4.0/words/convert?format=pdf" \
  -X PUT \
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \
  -H "Content-Type: multipart/form-data" \
  -F "Document=@${LOCAL_FILE}"

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:

  1. 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.

  2. Are there any recommended workarounds to prevent comments and review markups from appearing in the final PDF output?

Reference:

・Before Conversion: review_and_comment.word
・After Conversion: review_and_comment_convert.pdf
・API Version: v4.0
・Endpoint: https://api.aspose.cloud/v4.0/words/convert?format=pdf
・Request Method: HTTP PUT

review_and_comment_convert.pdf (13.0 KB)
review_and_comment.docx (17.8 KB)

We appreciate any guidance you can provide.
Thank you.

@nstock

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:

  1. 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);
    
  2. 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.

  3. 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!

Sources:
[1]: Word to PDF conversion dotnet SDK show/hide comments