Remove annotations

On this page

If the output PDF file contains annotations, you can remove them to reduce the file size.

To remove annotations, set the remove_annotations property to True.

The following code snippet shows how to remove annotations from the file:

with gv.Viewer("sample.docx") as viewer:

    viewOptions = gvo.PdfViewOptions()
    viewOptions.pdf_optimization_options = gvo.PdfOptimizationOptions()
    viewOptions.pdf_optimization_options.remove_annotations = True

    viewer.view(viewOptions)

The following image demonstrates the result:

Remove annotations

On this page