#ghostscript
Explore tagged Tumblr posts
Text
TIPS and TRICKS for LAWYERS:
judst fuck of
7 notes
·
View notes
Text
作弊条:将不规则尺寸的图片转换成信纸大小的 PDF
在日常文档处理中,我们时常会遇到需要将不规则尺寸的 PDF 文件调整为北美标准信纸大小(8.5英寸 x 11英寸)的需求,特别是在处理原始扫描的 PDF 时。本文将介绍如何借助 ImageMagick 和 GhostScript 软件来完成此转换,并确保文件保持较小的体积和清晰的质量。
本文假定输入的文件名为 input.pdf,只有 1 页,四边已 crop 好,文字内容周围留有足够的空白、无需进一步调整,直接缩放不会显著影响质量。
具体步骤
1. 将 PDF 转换成无损格式的高分辨率 TIFF 图片
使用以下命令将 PDF 文件转换为 300 DPI 的 TIFF 格式:
$ convert input.pdf -density 300 -resize 2550x3300 temp.tiff
此命令生成的 temp.tiff 文件尺寸最大为 2550x3300。其中,“宽为 2550 像素”及“高为 3300 像素”两个条件至少满足一条。将原始 PDF 转换为精度为 300 DPI 的无损 TIFF 图片格式,对于大部分印刷文本、图片需求,已足够清晰,并避免压缩过程中图像质量的损失。
2. 将调整好尺寸的 TIFF 图片转换成 PDF
$ convert temp.tiff -gravity north -extent 2550x3300 output.pdf
其中,-gravity north 使文件顶部对齐。也可以选择其他方向(northwest、center 较为常用)。-extent 参数补足 PDF 尺寸,原文件缺失的部分,默认以白色补足。
3. 压缩 PDF 文件
第二步生成的 PDF 文件尺寸较大(约 20MB),不便于传输、应用。可用 GhostScript 工具重新采样、压缩。
$ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output_compressed.pdf output.pdf
其中 PDFSETTINGS 可选的参数有:
/screen: 72 DPI
/ebook: 150 DPI
/printer: 300 DPI
/prepress: 高分辨率并���包含色彩信息
/default: 默认,效果介于 /screen 和 /printer 之间。
此步骤结束后输出的文件 output_compressed.pdf 即符合打印要求的文档。如果 PDF 内容以黑白文字为主,大小应在 1MB 以内。
注 1:如希望修改 ImageMagick 生成的 PDF 中的默认 metadata,可以这样操作:
首先建立一个名为 metadata.pdfmark 的文本文件,参考内容如下:(请适当修改)
[ /Title (Frank's Very Important Document) /Author (Frank Lin) /Subject (Frank's experiments with pdfmark) /Creator (https://linshuang.info/) /ModDate (D:20241101000000+01'00') /Producer (A 'pdfmark' trick with Ghostscript) /Keywords (Metadata, Ghostscript, PDF) /CreationDate (D:20241101000000+01'00') /DOCINFO pdfmark
(注意,文件末尾是“pdfmark”,不能以 ] 关闭)
将第三步中的 gs 命令后面增加一输入文件,即可覆盖 output.pdf 中的 metadata。
$ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output_compressed.pdf output.pdf
生成的文件在 Chrome 中看起来是这样的:
注 2:对于多页的 PDF,可写脚本对每页内容按类似方法处理,具体步骤从略。
0 notes
Text
22 notes
·
View notes
Text
frenchie-centric fic recs (mostly including kimiko)
Hi everyone so as an AVID frenchie fan and fic reader who has scrolled through the ENTIRE frenchie ao3 tag i thought i would compile a list of my fave fics! most of these are quite short/ one-shots, and they're in no particular order 🫶🫶🫶
-> don't think about the past (always there, anyway) by @abed_with_a_knife
this one is a sweet gift to the frenchie fandom in the way it's not sweet at all and actually so heart-wrenching. hughie wondering about frenchie's past and his coping mechanisms + why no one seems to like be concerned. also little nina angst shiii 😮💨 almost 10k too!!
-> you're a pal and a confidant by @listenlisten223
AMAZING exploration of the cherie + frenchie dynamic and some of their backstory. love love love love.
-> drink up your movements (still i can���t get enough) by @nevermesswithteddybears
OH THIS ONE MADE ME SICK!!!!!! angst. communication barriers. kimchie. i was ill at the end.
-> heel by @dickvinci
character study of frenchie, plus just a general exploration of frenchie + little nina and their time together. dickvinci nation rise!!!!
-> adding that to the list by @ghostscript
almost 20k of frenchie being a trainwreck and everyone being worried. my fav typa thing
-> i'm not yours by @rifff123
frenchie getting kidnapped by little nina. angst!! kimiko + mm teamup!! excellence!!
-> chopping block by @embir
S3 rewrite/companion piece. i tried not to include any incomplete fics but this is one is too amazing to not include. perfectly written angst and great exploration of frenchie's whole...thing
-> vendetta by @felldownthelist
mm, frenchie, and kimiko shenanigans
-> Three Times Kimiko Didn't Have To Speak, And Then That One Time Frenchie Didn't Have To by @tonytones
self explanatory. lovely exploration of their dynamic and communication style
-> my angels will watch me burn by @givemecourage
sad sad sad frenchie backstory
-> If You Hold Me Without Hurting Me, You'll Be The First Who Ever Did by @spooky_fan_me
post little nina gate, frenchie and kimiko taking care of each other. short and sweet and presh.
#the boys#frenchie the boys#kimiko the boys#the boys fic recs#please give these a read!!!#have at it kiddies
9 notes
·
View notes
Text
Trying to use ghostscript a cli tool to extract the text layer from a pdf (of a dead frenchman memoir) because I generally trust Google's OCR
ghostscript works fine, extraction works-
uh
this is art
help
this is google ocr's fault tbh
#cadmus rambles#cad rambles about dead frenchmen on main#im not good at commandline stuff and commandline text editors make me cry but it is satisfying when it works
13 notes
·
View notes
Text
Attackers Exploiting Remote Code Execution Vulnerability in Ghostscript
Source: https://www.securityweek.com/attackers-exploiting-remote-code-execution-vulnerability-in-ghostscript/
More info:
https://codeanlabs.com/blog/research/cve-2024-29510-ghostscript-format-string-exploitation/
https://www.openwall.com/lists/oss-security/2024/07/03/7
6 notes
·
View notes
Quote
「PostScript」や「PDF」を処理するインタプリタの「Ghostscript」の脆弱性について注意が呼びかけられている。3月から5月にかけてリリースされたアップデートで修正済みだという。 現地時間3月6日にリリースされた「同10.03.0」、5月2日にリリースされた「同10.03.1」にて複数の脆弱性が修正されているとして、注意喚起が行われたもの。 5月に「同10.03.1」がリリースされた際は、「CVE」ベースで5件の脆弱性を修正したことが公表されたが、特に脆弱性の言及がなかった「同10.03.0」においても、5件の脆弱性が修正されているという。 具体的には「CVE-2024-29506」「CVE-2024-29507」「CVE-2024-29508」「CVE-2024-29509」「CVE-2024-29511」で7月に入りメーリングリストで報告された。 5月10日のアップデートで修正された「CVE-2024-33871」については、共通脆弱性評価システム「CVSSv3.1」のベーススコアが「8.8」とされるほか、3月に修正された「CVE-2024-29511」が「7.5」と評価されている。ただし、「CVSS」基本値が現状示されていない脆弱性もある。 「同10.03.0」および「同10.03.1」にて修正された脆弱性は以下のとおり。 CVE-2023-52722 CVE-2024-29506 CVE-2024-29507 CVE-2024-29508 CVE-2024-29509 CVE-2024-29510 CVE-2024-29511 CVE-2024-33869 CVE-2024-33870 CVE-2024-33871
【セキュリティ ニュース】「Ghostscript」の脆弱性に注意 - 3月と5月の更新で修正済み(1ページ目 / 全1ページ):Security NEXT
2 notes
·
View notes
Photo
matija gabrilo, 2022 original image courtesy of ben westoby at ghostscript, modern art london
26 notes
·
View notes
Text
Why is Moodle not finding path to Ghostscript?
Is your path to Ghostscript not working on Moodle even though you can confirm that Ghostscript is installed, able to queried its version and can confirm that it is in fact in the correct path on the server and not an alias. Here is why Moodle is unable to ‘find’ Ghostscript even though the path is correct and GS is installed on the server. Continue reading Why is Moodle not finding path…
0 notes
Text
VeryDOC Postscript to Image Converter Command Line can convert any number of Postscript and PDF files into PNG, JPG, and TIFF files without limitations on maximum High Resolution, Paper Size or File Size
VeryDOC Postscript to Image Converter Command Line can convert any number of Postscript and PDF files into PNG, JPG, and TIFF files without limitations on maximum High Resolution, Paper Size or File Size.
In today's fast-paced digital environment, converting complex documents into high-quality images is a necessity for many industries. Whether it's for archiving, printing, or digital publishing, having the right tools to handle large files with precision and efficiency is crucial. The VeryDOC Postscript to Image Converter Command Line application is designed to meet these needs, offering a robust solution for converting PostScript (PS) and PDF files into high-resolution image formats.
✅ Unmatched Resolution and File Size Capabilities The VeryDOC Postscript to Image Converter Command Line stands out with its ability to produce extremely high-resolution images, such as 3000x3000 DPI. This feature is particularly useful for applications requiring detailed images, like digital archiving or large-scale printing. The resultant files, often in PNG or TIFF format, can exceed 10GB in size, ensuring that no detail is lost in the conversion process.
What sets this application apart is its use of disk files as cache, allowing it to bypass the typical limitations on resolution and file size. This means you can convert your PostScript and PDF files into images without worrying about exceeding maximum resolution thresholds or encountering file size restrictions.
✅ Batch Conversion for Efficiency For users who need to convert large volumes of files, the VeryDOC Postscript to Image Converter Command Line offers batch conversion capabilities. This feature allows you to convert any number of PostScript and PDF files to image files simultaneously, significantly improving workflow efficiency. Whether you're working with a handful of files or thousands, this tool can handle the job with ease.
✅ Versatile Conversion Options The VeryDOC Postscript to Image Converter Command Line is not just about high resolution; it also offers a wide range of conversion options:
RIP PostScript and EPS Files: Convert PS and EPS files into WYSIWYG raster images with precise detail.
Multiple Output Formats: Convert files into various image formats, including TIFF, JPG, PNG, BMP, WMF, EMF, PCX, and TGA, as well as vector formats like WMF and EMF.
Multi-page TIFF Support: Create multi-page TIFF files, ideal for document management and archiving.
ClassF TIFF Compatibility: Produce Fax-compatible TIFF files at standard resolutions such as 204x98 DPI and 204x196 DPI.
Resolution Specification: Customize the resolution of the generated images to meet specific needs, ensuring the best possible output quality.
✅ Standalone Software for Seamless Integration This converter is a standalone application, meaning it does not require Ghostscript or Acrobat Distiller to function. This makes it easier to integrate into your existing systems and workflows, reducing dependencies and potential compatibility issues.
✅ Command Line Flexibility The application can be launched from the command line, making it easy to automate through scripts, batch files, or integration with other applications. This flexibility is especially useful for developers and IT professionals looking to streamline their document conversion processes.
✅ International Language Support With support for multiple languages including English, French, German, Chinese, and many others, the VeryDOC Postscript to Image Converter Command Line is accessible to users around the globe, making it a versatile tool for international applications.
✅ Licensing Options VeryDOC offers two main licensing options to suit different use cases:
Server License: Ideal for deployment on production servers, this license allows the application to be easily integrated into server-side environments using ASP, PHP, C#, .NET, and more.
Developer License: This option is designed for developers who need to distribute the application across multiple servers or computers. It offers royalty-free runtime desktop distribution, providing maximum flexibility.
For organizations with unique requirements, VeryDOC also offers custom development services to tailor the application to specific needs.
✅ Conclusion
The VeryDOC Postscript to Image Converter Command Line application is a powerful, flexible tool designed to meet the high demands of modern digital workflows. With its ability to handle large file sizes, support for a wide range of formats, and flexible licensing options, it is an essential tool for any organization that needs to convert PostScript and PDF files into high-resolution images efficiently. Whether you're managing a large-scale document conversion project or need reliable image output for printing and archiving, VeryDOC has the solution you need.
0 notes
Text
Critical Ghostscript flaw exploited in the wild. Patch it now!
http://i.securitythinkingcap.com/T9KfzM
0 notes
Video
youtube
OSError: Unable to locate Ghostscript on paths -PYHTON
0 notes
Text
Cara Mengompresi Ukuran Berkas PDF pada Linux openSUSE
Salah satu fitur penyunting berkas PDF yang paling banyak saya manfaatkan belakangan ini adalah kompresi berkas. Mengurangi ukuran berkas PDF sangat berguna, terutama jika Anda perlu mengunggahnya ke internet atau mengirimkannya melalui email dengan batasan ukuran. Pada openSUSE, Anda dapat menggunakan Ghostscript, sebuah alat baris perintah yang kuat untuk melakukan tugas ini. Langkah 1:…
View On WordPress
0 notes
Text
Critical RCE found in popular Ghostscript open-source PDF library
https://www.bleepingcomputer.com/news/security/critical-rce-found-in-popular-ghostscript-open-source-pdf-library/
0 notes
Text
Ghostscript bug could allow rogue documents to run system commands
Source: https://nakedsecurity.sophos.com/2023/07/04/ghostscript-bug-could-allow-rogue-documents-to-run-system-commands/
2 notes
·
View notes