Purpose
Download the PDF associated with a Google Patents publication number and save it under the requested filename.
When to Use
Use when the caller provides a Google Patents publication number such as {publication-number} and wants the original patent document as a PDF. The application number or title may be used for caller-side verification, but the publication number is the stable URL key.
Workflow
- Navigate directly to
https://patents.google.com/patent/{publication-number}/zh(use another language suffix only if requested). - In the same browser session, run this evaluator on the loaded patent page to resolve the actual PDF URL:
(() => {
const meta = document.querySelector('meta[name="citation_pdf_url"]');
let pdfUrl = meta && meta.content ? meta.content.trim() : "";
if (!pdfUrl) {
const link = Array.from(document.querySelectorAll("a[href]")).find((a) => {
const href = a.href || "";
return (
/patentimages|\.pdf(?:$|[?#])/i.test(href) ||
/download\s*pdf/i.test((a.textContent || "").trim())
);
});
pdfUrl = link ? link.href : "";
}
const publication = decodeURIComponent(
location.pathname.split("/").filter(Boolean)[1] || "publication",
);
return {
pdfUrl,
filename: `原始申请-${publication}.pdf`,
publicationUrl: location.href,
};
})();- Download
pdfUrlusing the browser's download/save facility and store it as the caller-specified filename (for example,原始申请-{publication-number}.pdf). Do not rely on clicking the visible Download PDF text; the metadata URL is the shortest reliable resolution path.
Site-Specific Gotchas
- Google Patents exposes the document PDF through
meta[name="citation_pdf_url"], commonly pointing to apatentimages.storage.googleapis.comURL; that storage URL is not safely guessable from the publication number. - The publication-number URL is case-sensitive in practice for reliable matching; preserve the supplied identifier, including its country code and kind code.
- The page may be localized, but the PDF URL is generally independent of the
/zhlanguage suffix. - Verify the resolved page/publication before saving when the caller also supplies an application number or title; do not substitute a search result with a merely similar title.
Expected Output
A downloaded PDF from the resolved citation_pdf_url, saved under the caller's requested filename, plus the source publication URL and resolved PDF URL if reporting metadata.