#author("2024-12-05T11:35:16+00:00","default:hotate","hotate")
#author("2025-04-06T05:38:44+00:00","default:hotate","hotate")
#contents
&tag(PDF);

* 編集 [#e6d2b41d]
- [[Coherent PDF Command Line Tools and C/C++/Python/.NET/Java/JavaScript API Community Release>https://community.coherentpdf.com/]]
 The Coherent PDF Command Line Tools and C/C++/Python/.NET/Java/JavaScript API allow you to manipulate existing PDF files in a variety of ways.
-- [[CPDF:メッチャ多機能なPDFのコマンドライン・ツール | PDF>http://pdf-file.nnn2.com/?p=892]]
 機能のハイライト部分をピックアップします。各機能別に更に細かな設定や操作が出来るようになっています。
-- コメント:下記のコマンドで3列x4行の割付が出来た。ただし、ページ間に余白は設定出来ない様子。詳しくはマニュアルを参照。(2024/01/07)
 $ cpdf -impose-xy "3 4" in.pdf -o out.pdf
 Impose 3 across and 4 down on to new pages of 3 times the width and 4 times the height of the input ones.
-- コメント:[[Sequoia]]では下記の設定により動作した。(2024/12/05)
--- [[macOS 15 Sequoiaではランタイム保護のアップデートにより、署名/公証されていないアプリを開く際にコンテキストメニューからGatekeeperをオーバーライドすることが不可能に。>https://applech2.com/archives/20240807-apple-gatekeeper-update-in-macos-15-sequoia.html]]
 アプリをクリック後、システム設定アプリで[プライバシーとセキュリティ] → [セキュリティ]へ進み、そのアプリがなぜブロックされたかを確認してから[開く]をクリックすることが必要になるそうです。
- [[Qpdf : コマンドラインのPDFツール | PDF>http://pdf-file.nnn2.com/?p=865]]
 Qpdf とはPDF にパスワードと詳細レベルのセキュリティ設定が出来るコマンドラインのソフトです。
 PDF のマージや分割、画像の圧縮、PDF ファイルの内部構造の表示や点検操作、JSON形式への出力も出来ます。
- [[とらりもん - PDFファイルの編集>https://pen.envr.tsukuba.ac.jp/~torarimon/?PDF%A5%D5%A5%A1%A5%A4%A5%EB%A4%CE%B7%EB%B9%E7%A4%C8%CA%AC%CE%A5]]
 4アップ
 $ pdfnup --nup 2x2 --frame true --delta "5mm 5mm" input.pdf
- [[LinuxでPDFを編集するためのツール #Linux - Qiita>https://qiita.com/j0306043/items/dceba3e36845076aa5f1]]
 Linux (Ubuntu22.04)上でPDFファイルを編集するソフト・コマンドの私的な健忘録です。
- ページ分割、統合は[[PDFtk]]の利用が便利。(2024/03/05)
- [[PDF 1枚を複数枚に分割する(Mac)|ppp>https://note.com/ppp_dolce/n/nbde5c49649d8]]
 見開き1ページになっているPDFを2分割して印刷する方法をまとめておきます。Macのプレビューを使ってできるのでソフトウェアのダウンロードは不要です。
-- コメント:範囲指定をきっちり数字で入力出来るので確実。(2025/04/06)

* 作成 [#v2061dfd]
- [[CubePDF - CubeSoft>http://www.cube-soft.jp/cubepdf/]]
 CubePDFは、お使いの様々なアプリケーションからいつでも必要な時に、すばやくPDF形式などに変換することができる、とても便利なPDF作成ソフトです。
- [[wkhtmltopdf>http://wkhtmltopdf.org/]]
 wkhtmltopdf and wkhtmltoimage are open source (LGPLv3) command line tools to render HTML into PDF and various image formats using the Qt WebKit rendering engine.
- [[Word,Excel,PowerPointをPDFに一括変換 · GitHub>https://gist.github.com/oxoofo/786366]]
 Word,Excel,PowerPointをPDFに一括変換
-- コメント:OLE利用の為、動作環境は[[Windows]]に限定される。(2021/11/29)
-- コメント:[[PDF - PowerPoint>PowerPoint#sef0a0a9]]のオプションを追加することで処理に成功した。(2023/06/18)
 I got same error and adding ppt.visible = true was good enough for me.
- 関連:[[Word]], [[PowerPoint]]


* テキスト抽出 [#gfc02b0f]
** [[Windows]] [#acce167e]
- [[xdoc2txt]]

** [[Linux]] [#c378a9b3]
- [[サーバ上でPDFやオフィス文書からテキストを抜き出す方法あれこれ - ククログ(2010-08-02)>http://www.clear-code.com/blog/2010/8/2.html]]
 Windowsでテキストを抽出するソフトウェアとしてはxdoc2txtなどがありますが、ここでは、Linuxサーバ上でテキストを抽出する方法を紹介します。

** poppler [#yd849274]
- [[Linux:pdftotextコマンドでPDFからテキストを抽出 - HiiHahWIKI - making some notes for... ->http://www.hiihah.info/index.php?Linux%EF%BC%9Apdftotext%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%A7PDF%E3%81%8B%E3%82%89%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%82%92%E6%8A%BD%E5%87%BA]]
 popplerというPDFソフトウェアのコマンドラインツールでPDFからテキスト抽出ができるらしいということが分かった
- [[tech/note/PDFチェックツール - DRF wiki>http://drf.lib.hokudai.ac.jp/drf/index.php?tech%2Fnote%2FPDF%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%83%84%E3%83%BC%E3%83%AB]]
 Popplerを使う場合は、既にコマンドラインツールとして pdfinfo (PDFのプロパティ情報等を表示する) や pdfimages (PDFを画像に変換/抽出する) がある。

** [[Python]] [#bff81f66]
- [[PDFから全テキストを抽出する方法 - bitA Tech Blog>https://tech.bita.jp/article/18]]
 Pythonモジュールである「PDFMiner.six」を利用して、実際にPDFからテキストを抽出する方法を紹介していきたいと思います。
- [[Python, PyPDF2でPDFを結合・分割(ファイル全体・個別ページ) | note.nkmk.me>https://note.nkmk.me/python-pypdf2-pdf-merge-insert-split/]]
 IssueやPull Requestが溜まっており活発に開発されているという状況ではないが、シンプルなPDFファイルの処理であれば問題ない。
- [[ゼロからはじめるPython(70) Pythonを使って自動で申請書PDFに書き込もう(その2) | マイナビニュース>https://news.mynavi.jp/article/zeropython-70/]] (2020/11/16)
 以下のプログラムは、申請書PDF「form.pdf」を読み込んで、必要事項を記入して「output.pdf」に保存するものだ。
- [[Pythonを使えばテキストを含むPDFの解析は簡単だ・・・そんなふうに考えていた時期が俺にもありました - Qiita>https://qiita.com/mima_ita/items/d99afc28b6f51479f850]]
 ここで得た最も重要な知見は「PDFデータをコンピュータで読むのはやめとけ、あれは人間が読むものだ」ということ
- [[PythonでCSV, word, excel, PDF, txtなどテキストファイルから文字列を解析・抽出する処理の実装方法 - No Change No Life I/O>https://masanyon.com/python-csv-word-excel-pdf-txt-textfile-string-extract/]]
 今回は、PythonでCSV, word, excel, PDF, txtなどテキストファイルから文字列を抽出する処理の実装する方法について解説します。

*** 表(テーブル) [#a7836f62]
- [[あなたを死なせないためのプログラミング - Qiita>https://qiita.com/yossymura/items/b19d08235bdb44f06ae8]]
 おぉ、ちゃんと表を読み込んでDataframeにしてくれた!凄いなtabula-py!!全国のPDF嫌いの皆さん、たまには抗ってみるのもいいかもしれません。 
- [[いるかのボックス: PythonでPDFの表からデータを抽出する>https://irukanobox.blogspot.com/2019/09/pythonpdf.html]]
 抽出する表を含むPDFは、何かと話題のキャッシュレス決済によるポイント還元制度の公式サイトからダウンロードできる登録加盟店一覧のPDF。
- [[Pythonでpdfデータにあるテーブルデータを一括でcsvに直す方法 - Qiita>https://qiita.com/risako_/items/0c625a6bcb1cd80cf259]]
 何ページにもわたるテーブルデータ(pdf形式)をpythonとかでいじりたい時に!
-- コメント:上手く動かなかった。(2020/04/05)
- [[chezou/tabula-py: Simple wrapper of tabula-java: extract table from PDF into pandas DataFrame>https://github.com/chezou/tabula-py]]
 Simple wrapper of tabula-java: extract table from PDF into pandas DataFrame
-- [[tabula-py/tabula_example.ipynb at master · chezou/tabula-py>https://github.com/chezou/tabula-py/blob/master/examples/tabula_example.ipynb]]
 tabula-py is a tool for convert PDF tables to pandas DataFrame. tabula-py is a wrapper of tabula-java, which requires java on your machine. tabula-py also enales you to convert PDF tables into CSV/TSV files.

* 画像処理 [#n84b65f2]
** JavaScript [#i86c1e33]
- [[javascript - PDF.js Inserting Images - Stack Overflow>https://stackoverflow.com/questions/11750821/pdf-js-inserting-images]]
 UPDATE: the latest version of jsPDF (not to be confused with PDF.js) seems to work with images, see the sample on examples page.


* 関連 [#m870e621]
#taglist(tag=PDF)

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS