In this guide

Prepare a PDF for a clean handoff

Review scope, private information, readability and naming before sharing a PDF copy.

Direct answer

Decide which pages the recipient needs, then work from a copy and inspect both its visible contents and its document properties before giving it a clear delivery name and saving the final version. In the practice run, clearing the document information fields and XMP, then applying lossless stream compression, reduced the synthetic attachment from 4,805,271 to 8,706 bytes while preserving the rendered pages. Reopen the saved copy, check its page count, searchable text and appearance, and confirm the actual file meets the destination’s requirements before you attach it.

What to look for

Start here when a PDF is ready to leave your workspace but you still need to decide what belongs in the attachment. A draft may have a confusing name, include pages the recipient never asked for, reveal an author in its properties, or be larger than the receiving channel accepts. An export dialog only tells you where a file was saved. The recipient sees the saved copy, so review that copy with the same care you give the source.

The practice run covers naming, document metadata and lossless optimization. Use it to learn how to verify those changes against the original. For an actual document with a confidentiality or accessibility requirement, use an appropriate review for the material on the pages and the way the recipient will read it.

The rendered first page of the optimized PDF has the Approved meeting notes heading and the practice graphic.
The rendered first page of the optimized PDF has the Approved meeting notes heading and the practice graphic.

Why it happens

A PDF has several places to inspect. Page contents include text, images, footers, and material that may remain when a page is cropped. Document properties such as Title and Author live separately. A file may also have XML metadata, attachments, comments, links or form fields. A smaller attachment still deserves the same review for confidential content. An image stream can be large even when the page looks simple.

Before you begin

Download meeting-notes-internal-draft.pdf and keep it unchanged. This synthetic file has two pages, headed Approved meeting notes and Action items. It uses an uncompressed practice graphic and contains populated Title, Author, Subject, Keywords, Creator, Producer, creation and modification fields, plus an XMP packet. The file is 4,805,271 bytes. Use any working folder where you can keep a draft and a separate output side by side.

Write a short delivery purpose such as “Send the approved meeting notes and action list.” For the test, both pages are needed, and the intended attachment name is meeting-notes-approved.pdf. The known headings give you search terms for the output. The metadata and page renders give you separate checks for the cleanup and the content. If you apply the workflow to a document of your own, record its starting byte size and any properties you plan to remove or replace.

Steps

  1. Decide which pages and context belong in the copy.

    Open the source and check each page against the delivery purpose. The sample’s first page provides the approved notes and the second holds the action items, so both remain in the copy. In a longer PDF, keep any definitions, legends or introductory material the selected pages rely on. If the request is for an appendix only, check what the recipient needs to make sense of the figures before leaving out the surrounding pages.

    • Read small print, names and footers while the source is still open.
    • If you remove a whole page, use the page-selection workflow and check the resulting order.
    • For confidential text inside a retained page, use a tool that removes the actual content, then verify the result under the appropriate review procedure.
    • An overlay can change appearance while leaving underlying text in the file.
  2. Inspect document properties and choose a delivery name.

    Compare the document title shown in a viewer with the filename in the folder. On the test source, the filename says internal draft, Title says Draft product meeting and Author says Example editor. Decide whether the recipient needs identifying document properties and separate that decision from the name you use to attach the copy. Review XML metadata as well as the standard properties when the workflow can inspect both.

    • Name the result for the subject and scope.
    • pdf in the working folder.
    • Avoid stuffing unrelated personal details into the filename, which can appear in attachment lists or download histories.
    • If a version or date matters to the recipient, use a name you can explain in the delivery message.
    • Check the destination filename before writing any changes.
  3. Clear the sample metadata and write a new optimized copy.

    Use the following PyMuPDF operations in a folder containing the draft. The first operation clears standard document information. The second removes the XML metadata reference. The save options rewrite and compress the file with garbage collection. Choose a new output path to keep the draft available for comparison.

    • import pymupdf

    • with pymupdf.open(“meeting-notes-internal-draft.pdf”) as doc: doc.set_metadata({}) doc.del_xml_metadata() doc.save(“meeting-notes-approved.pdf”, garbage=4, deflate=True, deflate_images=True, use_objstms=1)

    • In the lab, the same save went to a temporary working copy that was then renamed to the delivery filename.

    • The test used stream compression without reducing the graphic’s pixel dimensions.

    • Measure the saved file on your device.

    • A PDF that already uses efficient encodings may offer less room for this kind of optimization.

  4. Reopen the result and review pages, text and properties.

    Close the editable document and open the saved attachment. Read the first and last headings, count the pages, test an expected search term and look for missing edges or unexpectedly blank areas. The practice export still has Approved meeting notes and Action items in order. We also compared extracted text, page rotation and rasterized page bytes against the draft at the same render settings. Both pages matched.

    • Check the file’s properties again from the saved copy.
    • The synthetic example’s populated Info fields and its XMP packet were gone when we reopened it.
    • If your real file depends on links, fillable fields, reading order or an existing signature, perform the review the receiving workflow requires.
    • Open important documents in another reader when possible to check the features that matter to that recipient.
  5. Check the attachment size and send a description of what it contains.

    Measure the actual file you will attach and compare it with the destination’s limit. The test draft was 4,805,271 bytes and the saved copy was 8,706 bytes. That change reflects the deliberately uncompressed graphic in this fixture. For your own document, record what you changed and use the observed output size rather than assuming the same result.

    • Confirm that the intended people can access the selected copy using the chosen sharing channel.
    • Explain which notes or attachments it includes and which approvals it represents.
    • Keep the source and reviewed copy until the handoff is complete.
    • If you later find a problem, send a clearly named replacement and identify the earlier file it supersedes.

Check your result

Use the before and after files in the sample list to check both sides of the operation. Open each PDF, confirm two pages, and locate Approved meeting notes and Action items. Compare the visible content and search for the same text in both files. Read the standard properties and inspect the XML metadata on the actual downloads. The draft has the listed sample values and XMP. The output has no Info dictionary and no linked XMP packet.

Compare file sizes and, if you want to identify the exact downloads from this run, check their SHA-256 digests in the measurement record. A hash can identify a file. For page equivalence, compare page text and renders separately, as the lab did. Review actual values when you use the same method on another input.

Measured verification table11 verified cases
CheckDraftApproved copy
Bytes48052718706
Pages22
titleDraft product meetingAbsent
authorExample editorAbsent
subjectSynthetic internal reviewAbsent
keywordspractice draftAbsent
creatorPDF guide fixtureAbsent
producerPyMuPDFAbsent
creationDateD:20261123090000ZAbsent
modDateD:20261123090000ZAbsent
XMP packetPresentAbsent

Common mistakes

Treating the delivery name as a cleanup step by itself. Open the file’s properties. Rename the output for the recipient, then inspect and handle metadata independently.

Clearing only the visible Title and Author. Inspect the other fields and the XML packet from the reopened output. The sample deliberately carries information in both places.

Choosing a smaller file without comparing its pages. Open the saved attachment, search for known text and review the smallest relevant details. Prefer the tested lossless options when the document already reads well.

Assuming page selection removes material within a retained page. Review visible and underlying page content for that condition, and apply the appropriate content removal procedure before sharing.

Limitations

The measured file is synthetic. The run verifies the sample’s document properties, XMP and page fidelity under the tested renderer. The conditions for sending a real document depend on its content, attachments, annotations, accessibility features and the recipient’s rules. Keep the original if an existing signature or a particular interactive feature matters.

Test record

Tested on 2026-11-23 with PyMuPDF 2.1 under Python 3.14.4. The file went from 4,805,271 to 8,706 bytes. The reopened copy had neither sample metadata store, and its 2 pages matched the source text, rotation and rendered pixels.

The measurement record lists the local outputs and their SHA-256 digests.

Tested in

  • Windows 10.0.22631, PyMuPDF 2.1
  • Windows 10.0.22631, Python 3.14.4

Questions

Can I replace a title without clearing every property?

Decide what the recipient needs and inspect the result you saved. For the practice file we deliberately cleared all populated standard fields and its XML packet. If you preserve or replace selected values, verify the actual output in each place that can carry those details.

Will every PDF shrink as much as the practice file?

Measure your own export. The draft fixture contains an uncompressed graphic, which gives this lossless rewrite a large amount of redundant data to compress. Readability, required features and the receiving limit are useful checks alongside the byte count.

How do I tell that text is still searchable?

Reopen the saved copy and search for a phrase you can see on a page. For the sample you can use Action items. If a scanned page consists of an image, arrange a separate text recognition and review step for the intended use.

Should I send the source alongside the cleaned file?

Check the delivery purpose and send the reviewed attachment needed for that purpose. Keep the source for verification and corrections. If the recipient needs an original or a signed copy, arrange the approved delivery for that document separately.

Browser-local utilityExtract a PDF page range

Export a copy of selected physical pages.

Extract a PDF page range