Repository navigation
v3.22.0
PDF figures with OCR, stored uploads and an Advanced settings panel in the web app. Before updating, read Upgrading: a compose file downloaded earlier needs two new variables, and a custom OCR endpoint receives new fields.
Added
pdf_imagesdecides what happens to the figures of an OCR-converted PDF. OnGET /api,/api/stream,POST /api/fileand MCPread_url(pdf_images), whenever OCR runs:strip(the default) puts a text line with the figure's id and size in its place, such as*[Abbildung: img-0.jpeg, 648×523 px]*;captiona short description the OCR provider writes in the same request, such as> **Abbildung** (img-0.jpeg, 648×523): …;hostedthe figure itself as an image link. Withlang=enthe label isFigureand descriptions are asked for in English (on the REST endpoints; MCP writesAbbildungand German descriptions); otherwise descriptions are asked for in German.hostedfalls back tocaptionwhen the instance doesn't host figures or a figure can't be stored, and a figure without a description gets thestripline; figures never make a conversion fail. PullMD asks for at most 40 figures per document and skips images smaller than 50 px; figures after the 40th are left out without a marker.pdf_imageson its own doesn't bypass the cache.- Hosted PDF figures (
PULLMD_IMAGE_HOSTING, off by default). With it on,pdf_images=hostedstores the figures in animagesfolder next to the database (/data/imageswith the shipped compose files, which setCACHE_DB=/data/cache.db) and links them at/img/<id>.<ext>underPUBLIC_URL, never under the host a request names. WithoutPUBLIC_URL,hostedworks ascaption,/api/configreportsimageHosting: falseand PullMD logs a warning at startup; the shipped compose files setPUBLIC_URL. The id is 128 random bits and the address works without sign-in, like a share link; unknown ids answer404(Image not found or expired) and count toward the same per-address limit as unknown share links. Figures come at the resolution the OCR provider returns, at most 4 MB each and 20 MB per document; a figure over a limit falls back to its description. They live as long as their conversion: deleting it, the end ofPULLMD_CACHE_RETENTION_DAYSor a new conversion of the same URL, when the new result is cached, removes them, also afterPULLMD_IMAGE_HOSTINGhas been turned off again. The shipped compose files pass the variable through. - MCP tool
get_image. Returns a hosted figure as an image, by id or by its/img/address. It exists only whenPULLMD_IMAGE_HOSTINGis on. - Keep an upload with
store=true(PULLMD_UPLOAD_STORE, on by default).POST /api/file?store=true, also withasync=1, keeps the converted result like a URL conversion: it gets a share id (X-Share-Id,shareId) and a history entry titled with the file name, and is kept forPULLMD_CACHE_RETENTION_DAYS. Withpdf_images=hostedthe figures are kept too, andhostedon an upload works only together withstore=true. The uploaded file itself is still never stored. On an instance without sign-in and with public history, everyone who can reach the instance sees these entries;PULLMD_UPLOAD_STORE=falsemakes PullMD ignorestore. With sign-in on, deleting your own stored upload removes it for everyone, with its share link and figures, although the answer saysscope: user; a user'sDELETE /api/cachedoes the same for all of their stored uploads. The shipped compose files pass the variable through. - A Store uploads toggle in the web app. Store uploads (Uploads speichern), in the Advanced panel, keeps uploads with
store=true. A stored upload shows its share link, and its history entry reads File (Datei) and opens the stored result. The toggle shows only when the instance allows stored uploads. Hosted figures of this instance load in an upload's result without Load images; other images stay held back. /api/configreportsimageHostinganduploadStore.- An Advanced panel in the web app. A collapsible Advanced (Erweitert) panel under the URL field offers settings beyond the bar, in four groups. Reddit and Hacker News: Depth, All, Max. count (
comment_limit) and Describe images in posts (images). YouTube: Timecodes (yt_timecodes) and Block length (yt_chunk). PDFs and documents: Figures (pdf_images: Omit isstrip, the default, Describe iscaptionand Include ishosted; it works only with PDF OCR on, Include shows only on an instance that hosts figures, and for an upload Include also needs Store uploads, otherwise the figures are described) and Store uploads (store, for file uploads). Web pages: Extractor (extractor) and Browser rendering (render). A group or option shows only when the instance offers it. The settings are kept in the browser. Closed, the panel shows n changed; Reset restores its defaults, and Fetch fresh fetches the URL once, skipping the cache. A non-default extractor, rendering or YouTube value skips the cache, like the matching API parameters. Opening a history entry doesn't send the extractor, rendering, YouTube options, Max. count or image description; a depth other than3, All and PDF OCR still skip the cache and replace the cached copy. A stored Include on an instance that doesn't host figures is sent ascaption. /api/configreportstrafilatura,playwrightandembeddedImages.trafilaturaandplaywrightare true whenTRAFILATURA_URLorPLAYWRIGHT_URLis set.embeddedImagesis true when the instance can describe embedded images: a vision key is set andPULLMD_EMBEDDED_IMAGESisn'toff.
Changed
- Depth and All moved from the bar into the Advanced panel. The bar keeps Comments, Frontmatter, PDF OCR and Pull.
- OCR results no longer contain broken image links. The OCR provider's placeholders such as
pointed at nothing; every OCR result now has thestripline (or the formpdf_imagesasks for) in their place. - Every OCR request now carries
image_min_sizeandimage_limit, for descriptions alsobbox_annotation_format, and for hosted figuresinclude_image_base64. A custom endpoint set withPULLMD_PDF_OCR_BASE_URLthat rejects these fields with an error status makes PullMD use the standard conversion for every PDF. format=textkeeps the alt text of inlinedata:images. Before, the whole base64 payload of such an image ended up in the plain text.
Fixed
- Share links of OCR conversions keep the OCR result. Opened after an hour, a share link of a PDF converted with
pdf=ocrfetched the PDF again without OCR and silently replaced the result with the standard conversion. OCR conversions and stored uploads are now served as stored and never fetched again (/s/<id>and MCPget_share).