home.social

#pymupdf — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #pymupdf, aggregated by home.social.

  1. “Banish the ghosts”

    #Censor, the #PDF document #redaction tool for the @gnome desktop, was released in version 0.8.0: codeberg.org/censor/Censor/rel

    This version comes with major improvements to secure redaction of invisible elements: first, point- or line-like elements on page borders, and second, elements located outside of pages, quasi in infinity. These “ghosts” are now redacted or you’ll get warned during post-redaction-validation if redaction wasn’t possible. I discovered these issues in a few PDF documents after adding another big testing sample dataset, kindly provided by the #OpenPreservationFoundation: github.com/openpreserve/format

    Find Censor on @flathub: flathub.org/apps/page.codeberg and @Codeberg: codeberg.org/censor/Censor or get it from your distribution package maintainers: repology.org/project/censor-do

    Thanks to its translators, Censor is currently available in 17 languages. I welcome your contribution to translations at #CodebergTranslate: translate.codeberg.org/engage/

    #censorship #Codeberg #Flathub #GNOME #GTK4 #linux #python #MuPDF #PyMuPDF

  2. “Banish the ghosts”

    #Censor, the #PDF document #redaction tool for the @gnome desktop, was released in version 0.8.0: codeberg.org/censor/Censor/rel

    This version comes with major improvements to secure redaction of invisible elements: first, point- or line-like elements on page borders, and second, elements located outside of pages, quasi in infinity. These “ghosts” are now redacted or you’ll get warned during post-redaction-validation if redaction wasn’t possible. I discovered these issues in a few PDF documents after adding another big testing sample dataset, kindly provided by the #OpenPreservationFoundation: github.com/openpreserve/format

    Find Censor on @flathub: flathub.org/apps/page.codeberg and @Codeberg: codeberg.org/censor/Censor or get it from your distribution package maintainers: repology.org/project/censor-do

    Thanks to its translators, Censor is currently available in 17 languages. I welcome your contribution to translations at #CodebergTranslate: translate.codeberg.org/engage/

    #censorship #Codeberg #Flathub #GNOME #GTK4 #linux #python #MuPDF #PyMuPDF

  3. Невидимый слой PDF с инструкциями для ботов

    Невидимый текстовый слой PDF можно редактировать и экспортировать в Markdown, JSON и TXT. Такие документы называются адаптивными PDF , они созданы для чтения и людьми, и роботами. Люди видят обычный PDF, а роботы — отдельный слой ActualText с текстом в Markdown и картинками в base64.

    habr.com/ru/companies/globalsi

    #markdown #разметка #PyMuPDF #умный_PDF #Adaptivepdf #PyMuPDF4LLM #OCR #pdx #Poppler

  4. #Censor, the #PDF document #redaction tool for the #GNOME desktop, was released in version v0.7.3. Find it at @flathub: flathub.org/apps/page.codeberg and @Codeberg: codeberg.org/censor/Censor or get it from your distribution package maintainers: repology.org/project/censor-do (currently AUR, ALT Linux, and NixOS).

    A bug was fixed that sometimes prevented files to be saved with the “Save” menu entry or associated keyboard shortcut `Ctrl`+`S`. Censor’s #Flatpak package comes with the latest version of the upstream library #PyMuPDF (1.28.0).

    Three new languages have been added to Censor since the last announcement here: Basque, Swedish, and Ukrainian. Thanks to the translators! You may contribute to translations at translate.codeberg.org/engage/

    #censorship #Codeberg #Flathub #GNOME #linux #python #MuPDF

  5. #Censor, the #PDF document #redaction tool for the #GNOME desktop, was released in version v0.7.3. Find it at @flathub: flathub.org/apps/page.codeberg and @Codeberg: codeberg.org/censor/Censor or get it from your distribution package maintainers: repology.org/project/censor-do (currently AUR, ALT Linux, and NixOS).

    A bug was fixed that sometimes prevented files to be saved with the “Save” menu entry or associated keyboard shortcut `Ctrl`+`S`. Censor’s #Flatpak package comes with the latest version of the upstream library #PyMuPDF (1.28.0).

    Three new languages have been added to Censor since the last announcement here: Basque, Swedish, and Ukrainian. Thanks to the translators! You may contribute to translations at translate.codeberg.org/engage/

    #censorship #Codeberg #Flathub #GNOME #linux #python #MuPDF

  6. “Annotation censoring everywhere”

    #Censor, the #PDF document #redaction tool for the #GNOME desktop, got a minor update to v0.7.1. Find it at @flathub: flathub.org/apps/page.codeberg and @Codeberg: codeberg.org/censor/Censor

    Censor’s #Flatpak package comes with the latest version of the upstream library #PyMuPDF (1.27.2.3). This solves an issue with annotations that could not be redacted in some files. Thanks to Julian Smith from #Artifex for fixing it upstream. In case you do not use the Flatpak package, you may need to wait for your distribution maintainers to update PyMuPDF’s version.

    Hindi has been added to the languages you may now speak with Censor. Thanks to the translators!

    #censorship #Codeberg #Flathub #GNOME #linux #python #MuPDF

  7. “Annotation censoring everywhere”

    #Censor, the #PDF document #redaction tool for the #GNOME desktop, got a minor update to v0.7.1. Find it at @flathub: flathub.org/apps/page.codeberg and @Codeberg: codeberg.org/censor/Censor

    Censor’s #Flatpak package comes with the latest version of the upstream library #PyMuPDF (1.27.2.3). This solves an issue with annotations that could not be redacted in some files. Thanks to Julian Smith from #Artifex for fixing it upstream. In case you do not use the Flatpak package, you may need to wait for your distribution maintainers to update PyMuPDF’s version.

    Hindi has been added to the languages you may now speak with Censor. Thanks to the translators!

    #censorship #Codeberg #Flathub #GNOME #linux #python #MuPDF

  8. “Zoom in, zoom out, redact your points!”

    #Censor v0.7.0 ships improved zooming with pinch-to-zoom gesture on touchpads and touchscreens and various security bug fixes. Find it at @flathub: flathub.org/apps/page.codeberg and @Codeberg: codeberg.org/censor/Censor

    You may now redact safely also #PDF documents with cropped, scaled, or rotated pages. The upstream #PyMuPDF library has some issues treating these documents. Thus, I implemented manual transformation and drawing of the redaction rectangles, and verified the proper redaction with a specially created sample document, submitted to the collection by #pypdf: github.com/py-pdf/sample-files

    Additionally, point- or line-like elements are now properly redacted. Sanitization during post-processing keeps now entries in form fields (note: this changes previous behavior).

    Thanks to the translators, Censor is now available in 13 languages including Croatian and Russian.

    #censorship #redaction #Codeberg #Flatpak #Flathub #GNOME #linux #python #MuPDF

  9. “Zoom in, zoom out, redact your points!”

    #Censor v0.7.0 ships improved zooming with pinch-to-zoom gesture on touchpads and touchscreens and various security bug fixes. Find it at @flathub: flathub.org/apps/page.codeberg and @Codeberg: codeberg.org/censor/Censor

    You may now redact safely also #PDF documents with cropped, scaled, or rotated pages. The upstream #PyMuPDF library has some issues treating these documents. Thus, I implemented manual transformation and drawing of the redaction rectangles, and verified the proper redaction with a specially created sample document, submitted to the collection by #pypdf: github.com/py-pdf/sample-files

    Additionally, point- or line-like elements are now properly redacted. Sanitization during post-processing keeps now entries in form fields (note: this changes previous behavior).

    Thanks to the translators, Censor is now available in 13 languages including Croatian and Russian.

    #censorship #redaction #Codeberg #Flatpak #Flathub #GNOME #linux #python #MuPDF

  10. “Secure #redaction by design and through extensive #testing

    #Censor 0.6.0 comes with many more #security improvements, motivated by extensive testing on more then 1,000 #PDF document samples. You may now redact securely also links, form fields and widgets. In rare cases, when partial image redaction fails, the more secure full image removal is used instead.

    But even more important, Censor now warns you, when unsuccessful redaction is detected during postprocessing. This reduces the impact of known issues of unsecure redaction.

    Polish is the 11th language you may speak with Censor. Thanks to its translators (among them, @mondstern)!

    Thanks a lot also to #pypdf, #qpdf, #pikepdf, #Ghostscript, #MuPDF, #PyMuPDF, and #poppler contributors for the great resource of PDF document samples!

    Find it at @flathub: flathub.org/apps/page.codeberg and @Codeberg: codeberg.org/censor/Censor

    #Censorship #Codeberg #Flathub #GNOME #Linux #Python

  11. “Secure #redaction by design and through extensive #testing

    #Censor 0.6.0 comes with many more #security improvements, motivated by extensive testing on more then 1,000 #PDF document samples. You may now redact securely also links, form fields and widgets. In rare cases, when partial image redaction fails, the more secure full image removal is used instead.

    But even more important, Censor now warns you, when unsuccessful redaction is detected during postprocessing. This reduces the impact of known issues of unsecure redaction.

    Polish is the 11th language you may speak with Censor. Thanks to its translators (among them, @mondstern)!

    Thanks a lot also to #pypdf, #qpdf, #pikepdf, #Ghostscript, #MuPDF, #PyMuPDF, and #poppler contributors for the great resource of PDF document samples!

    Find it at @flathub: flathub.org/apps/page.codeberg and @Codeberg: codeberg.org/censor/Censor

    #Censorship #Codeberg #Flathub #GNOME #Linux #Python

  12. От вет-ИИ для коров до имперского глянца: хардкорный MLOps на бесплатных GPU

    В начале 2026 года ленты новостей принесли тревожные сообщения из Сибири: массовые вспышки опасных заболеваний у КРС (крупного рогатого скота) привели к необходимости вынужденного забоя тысяч голов. Для многих фермеров это означало потерю бизнеса и средств к существованию. Мы задались вопросом: может ли доступный Computer Vision стать первой линией обороны? Инструментом, который позволит фермеру в отдаленном районе провести первичный скрининг (триаж) животного с помощью обычного смартфона и вовремя вызвать ветеринара, не дожидаясь начала эпидемии. Так родился проект AI-Vet-Scanner ( наше пространство на Hugging Face ), определяющий признаки заболеваний по фотографии.

    habr.com/ru/articles/1013214/

    #MLOps #Kaggle #Computer_Vision #OpenCV #PyMuPDF #Hugging_Face #датасет #парсинг #оптимизация_памяти #SDXL_LoRA

  13. That said and celebrated ;), there are things that #Censor is not yet well redacting.

    The upstream library #MuPDF (with its #Python bindings in #PyMuPDF) supports by default only redaction of text, vector graphics and images. Testing on a variety of PDF files (thanks to #pypdf, #qpdf, #ghostscript, and their issue reporters, as well as @pdfarranger for their hint) let me discover that some vector graphics are not properly redacted and an upstream issue has been reported for that.

    Also, form fields (widgets), signatures and links may be incompletely redacted.

    You can find an updated list of “What is redacted? What not?” here: codeberg.org/censor/Censor/iss

    #pdf #redaction #security

  14. That said and celebrated ;), there are things that #Censor is not yet well redacting.

    The upstream library #MuPDF (with its #Python bindings in #PyMuPDF) supports by default only redaction of text, vector graphics and images. Testing on a variety of PDF files (thanks to #pypdf, #qpdf, #ghostscript, and their issue reporters, as well as @pdfarranger for their hint) let me discover that some vector graphics are not properly redacted and an upstream issue has been reported for that.

    Also, form fields (widgets), signatures and links may be incompletely redacted.

    You can find an updated list of “What is redacted? What not?” here: codeberg.org/censor/Censor/iss

    #pdf #redaction #security

  15. “Better safe than sorry”

    For release 0.5.0 of #Censor, a lot of work went into improving the security of PDF redaction.

    PDF documents are tricky, and irrevocably removing elements from them is even more. With this release, before saving a redacted document, garbage is now properly collected and documents are sanitized, which means that metadata, page thumbnails, etc. are removed.

    Also, vector graphics are now removed with a more strict option when they overlap with redaction rectangles. On top of that, I added redaction of PDF annotations.

    The user interface was refreshed: with undo and redo buttons in the toolbar and improved document saving experience. Drawing rectangles is now indicated by a crosshair cursor.

    Thanks to the translators, you may now talk also Czech with Censor!

    Get it from @flathub: flathub.org/apps/page.codeberg, or contribute on @Codeberg: codeberg.org/censor/Censor

    #censorship #redaction #PDF #Codeberg #Flatpak #Flathub #GNOME #python #MuPDF #PyMuPDF #linux

  16. “Better safe than sorry”

    For release 0.5.0 of #Censor, a lot of work went into improving the security of PDF redaction.

    PDF documents are tricky, and irrevocably removing elements from them is even more. With this release, before saving a redacted document, garbage is now properly collected and documents are sanitized, which means that metadata, page thumbnails, etc. are removed.

    Also, vector graphics are now removed with a more strict option when they overlap with redaction rectangles. On top of that, I added redaction of PDF annotations.

    The user interface was refreshed: with undo and redo buttons in the toolbar and improved document saving experience. Drawing rectangles is now indicated by a crosshair cursor.

    Thanks to the translators, you may now talk also Czech with Censor!

    Get it from @flathub: flathub.org/apps/page.codeberg, or contribute on @Codeberg: codeberg.org/censor/Censor

    #censorship #redaction #PDF #Codeberg #Flatpak #Flathub #GNOME #python #MuPDF #PyMuPDF #linux

  17. “A historic moment for Censor”

    #Censor – the PDF redaction tool for the @gnome desktop – comes now with a new edit history. It allows you to undo and redo redactions using the right-click context menu or keyboard shortcuts. Also, a bug that prevented repeated saving to the same file path was fixed.

    Get the new version from @flathub: flathub.org/apps/page.codeberg, and find it on @Codeberg: codeberg.org/censor/Censor/rel

    You may now talk Chinese, Dutch, English, Estonian, Finnish, French, German, Italian, and Vietnamese with Censor (thanks a lot to the translators!). If your language is missing from this list I invite you to contribute at Codeberg Translate: translate.codeberg.org/engage/

    #censorship #redaction #PDF #Codeberg #Flatpak #Flathub #GNOME #python #MuPDF #PyMuPDF #Linux

  18. “A historic moment for Censor”

    #Censor – the PDF redaction tool for the @gnome desktop – comes now with a new edit history. It allows you to undo and redo redactions using the right-click context menu or keyboard shortcuts. Also, a bug that prevented repeated saving to the same file path was fixed.

    Get the new version from @flathub: flathub.org/apps/page.codeberg, and find it on @Codeberg: codeberg.org/censor/Censor/rel

    You may now talk Chinese, Dutch, English, Estonian, Finnish, French, German, Italian, and Vietnamese with Censor (thanks a lot to the translators!). If your language is missing from this list I invite you to contribute at Codeberg Translate: translate.codeberg.org/engage/

    #censorship #redaction #PDF #Codeberg #Flatpak #Flathub #GNOME #python #MuPDF #PyMuPDF #Linux

  19. Censor, a new document redaction tool, is there!

    It allows to draw black rectangles on PDF documents and to permanently remove the text and images below. Find it on @Codeberg: codeberg.org/censor/Censor, get it from @flathub: flathub.org/apps/page.codeberg, or translate it on Codeberg Translate: translate.codeberg.org/engage/!

    It is a free and open-source graphical user interface (GUI) for #Linux and the #GNOME desktop, and uses the #MuPDF library with its #python bindings from the #PyMuPDF module.

    #censorship #redaction #PDF #Codeberg #Flatpak #Flathub

  20. Censor, a new document redaction tool, is there!

    It allows to draw black rectangles on PDF documents and to permanently remove the text and images below. Find it on @Codeberg: codeberg.org/censor/Censor, get it from @flathub: flathub.org/apps/page.codeberg, or translate it on Codeberg Translate: translate.codeberg.org/engage/!

    It is a free and open-source graphical user interface (GUI) for #Linux and the #GNOME desktop, and uses the #MuPDF library with its #python bindings from the #PyMuPDF module.

    #censorship #redaction #PDF #Codeberg #Flatpak #Flathub

  21. After struggling to get #python #PyMuPDF to work and being close the deadline, I shifted to using a combination of other commands.

    First using the #linux #pdftohtml command, which is so much faster than PyMuPDF and packages the result similar to saving a website.

    Next with #NeoVim and #RegEx format the #HTML file to be able to be quickly processed with #NodeJs #cheerio and eventually through #json to be saved in #sqlite.

    Is it elegant and automatic? No, though it works!

    #JavaScript

  22. After struggling to get #python #PyMuPDF to work and being close the deadline, I shifted to using a combination of other commands.

    First using the #linux #pdftohtml command, which is so much faster than PyMuPDF and packages the result similar to saving a website.

    Next with #NeoVim and #RegEx format the #HTML file to be able to be quickly processed with #NodeJs #cheerio and eventually through #json to be saved in #sqlite.

    Is it elegant and automatic? No, though it works!

    #JavaScript

  23. Further while trying to extract and format data from PDFs using #python #PyMuPDF.

    I was trying to create a perfect chain of functions that would format all the edge cases into the final desired #HTML format. This is where I quickly realized running every tweaked version of the functions on the 100 page PDF is quite time consuming.

    Instead I can run it once and save the results in a #sqlite database. Then create #sql queries to do post processing on the edge cases while having a good enough way to observe the contents of each page over the pervious method of posting the output into the #terminal and scrolling to the desired page. And in the end, I am one step closer of having the data in a #csv file, which is easily exported with #Dbeaver.

  24. Further while trying to extract and format data from PDFs using #python #PyMuPDF.

    I was trying to create a perfect chain of functions that would format all the edge cases into the final desired #HTML format. This is where I quickly realized running every tweaked version of the functions on the 100 page PDF is quite time consuming.

    Instead I can run it once and save the results in a #sqlite database. Then create #sql queries to do post processing on the edge cases while having a good enough way to observe the contents of each page over the pervious method of posting the output into the #terminal and scrolling to the desired page. And in the end, I am one step closer of having the data in a #csv file, which is easily exported with #Dbeaver.

  25. Currently trying to extract and format data from PDFs using #python #PyMuPDF.

    Initially used the `get_text(value)` method with the `"text"` value, only to learn that I could have potentially saved time directly using the `"html"` value, since I have been creating pattern matchers to format the text into #HTML.

    After investigation, although the html option exists, the post processing is more strenuous than the initial approach.

    My fascination with the `get_text(value)` method is that each value packages the data differently. Where as `"html"` puts the text in `<p><span>text</span></p>`, `"xhtml"` puts it instead in `<h1>text</h1>`.

  26. Currently trying to extract and format data from PDFs using #python #PyMuPDF.

    Initially used the `get_text(value)` method with the `"text"` value, only to learn that I could have potentially saved time directly using the `"html"` value, since I have been creating pattern matchers to format the text into #HTML.

    After investigation, although the html option exists, the post processing is more strenuous than the initial approach.

    My fascination with the `get_text(value)` method is that each value packages the data differently. Where as `"html"` puts the text in `<p><span>text</span></p>`, `"xhtml"` puts it instead in `<h1>text</h1>`.

  27. I just updated my 2023 post on extracting text from #EPUB files in #Python, and added an evaluation of #PyMuPDF (which also supports EPUB!). Includes link to demo script.

    bitsgalore.org/2023/03/09/extr

  28. I just updated my 2023 post on extracting text from #EPUB files in #Python, and added an evaluation of #PyMuPDF (which also supports EPUB!). Includes link to demo script.

    bitsgalore.org/2023/03/09/extr

  29. Ever felt the need to convert a #PDF into a fixed-layout #EPUB that preserves the table of contents, internal cross-references and hyperlinks? Finding no out-of-the-box solution, I've developed one myself using #Python and the #PyMuPDF library. Here it is, open source, and ready for use:

    github.com/aourednik/pdf2epub3

    My script is particularly suitable for the conversion of complex layout PDFs generated with variants of #TeXLaTeX.
    Enjoy!

  30. Ever felt the need to convert a #PDF into a fixed-layout #EPUB that preserves the table of contents, internal cross-references and hyperlinks? Finding no out-of-the-box solution, I've developed one myself using #Python and the #PyMuPDF library. Here it is, open source, and ready for use:

    github.com/aourednik/pdf2epub3

    My script is particularly suitable for the conversion of complex layout PDFs generated with variants of #TeXLaTeX.
    Enjoy!

  31. Today I managed to cobble up a #Python script to remove your name from #PDF annotations using #PyMuPDF and #FreeSimpleGUI, then I tried #pyinstaller and I have something that seems to run on Linux... so many steps!!!

    It never ceases to amaze me how hard it its to provide software for other people to run!

    If you think it could be useful to you or someone, I AGPL licensed it here:

    github.com/villares/anonymize-

    UPDATE: @Introscopia built a Windows.exe version for me also using pyinstaller, yay!

  32. Today I managed to cobble up a #Python script to remove your name from #PDF annotations using #PyMuPDF and #FreeSimpleGUI, then I tried #pyinstaller and I have something that seems to run on Linux... so many steps!!!

    It never ceases to amaze me how hard it its to provide software for other people to run!

    If you think it could be useful to you or someone, I AGPL licensed it here:

    github.com/villares/anonymize-

    UPDATE: @Introscopia built a Windows.exe version for me also using pyinstaller, yay!

  33. Here's a sneak peek at a #PDF Quality Assessment tool I'm working on for digitisation batches , mostly based on #PyMuPDF, #pillow and #Schematron:

    github.com/KBNLresearch/pdfqua

    (Wouldn't recommend this for production yet, as it's not completely finished, and I'm still changing some things around.)

    #wtfPDF

  34. Here's a sneak peek at a #PDF Quality Assessment tool I'm working on for digitisation batches , mostly based on #PyMuPDF, #pillow and #Schematron:

    github.com/KBNLresearch/pdfqua

    (Wouldn't recommend this for production yet, as it's not completely finished, and I'm still changing some things around.)

    #wtfPDF

  35. Discover how to extract images from PDFs using PyMuPDF in Python. This comprehensive guide covers installation, code explanation, best practices, and tips for efficient PDF image extraction. #PDFimageextraction #Python #PyMuPDF

    teguhteja.id/pdf-image-extract

  36. Discover how to extract images from PDFs using PyMuPDF in Python. This comprehensive guide covers installation, code explanation, best practices, and tips for efficient PDF image extraction. #PDFimageextraction #Python #PyMuPDF

    teguhteja.id/pdf-image-extract

  37. #python #linguistics #NLP #pymupdf

    Let's say I have a raw text that I got from a pdf , where the authors of said pdf are too boomer to release it as a structured text.

    But there are Keywords and chapters.

    Do you have good advice or a good resource for how to get that structure back from the content?

    (I'm going into it with the agenda to prove that they are badly written, so if I can't identify what a paragraph is about that's "good")

  38. #python #linguistics #NLP #pymupdf

    Let's say I have a raw text that I got from a pdf , where the authors of said pdf are too boomer to release it as a structured text.

    But there are Keywords and chapters.

    Do you have good advice or a good resource for how to get that structure back from the content?

    (I'm going into it with the agenda to prove that they are badly written, so if I can't identify what a paragraph is about that's "good")

  39. I love and hate what my job makes me do.

    I do just love #python

    Learned how to extract geometry and text info from pdf drawings with #pymupdf

    "... sufficiently advanced technology" indeed.

  40. Estou realmente muito impressionado com #PyMuPDF "import fitz" pymupdf.readthedocs.io/en/late

    Está parecendo a biblioteca atual mais poderosa para manipular #PDF com #Python

    (Em breve vou postar o meu #fanzine impositionator-tabajara usando PyMuPDF WIP: gist.github.com/villares/0402a)

  41. Estou realmente muito impressionado com #PyMuPDF "import fitz" pymupdf.readthedocs.io/en/late

    Está parecendo a biblioteca atual mais poderosa para manipular #PDF com #Python

    (Em breve vou postar o meu #fanzine impositionator-tabajara usando PyMuPDF WIP: gist.github.com/villares/0402a)

  42. I used to be able to point my #ThonnyIDE to a #conda env but in this other computer I can't seem to make it work anymore :((

    Update 1: Well, it runs, but some libraries seem to break :((

    (maybe the lib is not well behaved, but I don't have the energy to chase this right now)

    Update 2: #PyMuPDF I'm looking at you!

    (runs fine from the command line or from Thonny's other env, go figure)

  43. I used to be able to point my #ThonnyIDE to a #conda env but in this other computer I can't seem to make it work anymore :((

    Update 1: Well, it runs, but some libraries seem to break :((

    (maybe the lib is not well behaved, but I don't have the energy to chase this right now)

    Update 2: #PyMuPDF I'm looking at you!

    (runs fine from the command line or from Thonny's other env, go figure)