|
@@ -0,0 +1,126 @@
|
|
|
|
+%define name extractpdfmark
|
|
|
|
+%define version 1.0.2
|
|
|
|
+%define release 2%{?_dist_release}
|
|
|
|
+
|
|
|
|
+Summary: Extract page mode and named destinations as PDFmark from PDF
|
|
|
|
+Summary(ja): PDFからページモードやリンクの宛先名を抽出しPDFmarkとして保存する
|
|
|
|
+Name: %{name}
|
|
|
|
+Version: %{version}
|
|
|
|
+Release: %{release}
|
|
|
|
+
|
|
|
|
+Source0: https://github.com/trueroad/extractpdfmark/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
|
|
|
+
|
|
|
|
+License: GPLv3+
|
|
|
|
+Group: Applications/Publishing
|
|
|
|
+URL: http://poppler.freedesktop.org/%{name}-%{version}.tar.xz
|
|
|
|
+
|
|
|
|
+BuildRequires: poppler-devel
|
|
|
|
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
|
|
+
|
|
|
|
+Vendor: Project Vine
|
|
|
|
+Distribution: Vine Linux
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+%description
|
|
|
|
+When you create a PDF document using a TeX system,
|
|
|
|
+you may include many small PDF files in the main PDF file.
|
|
|
|
+It is common for each of those files to use the same fonts.
|
|
|
|
+
|
|
|
|
+If the small PDF files contain embedded font subsets,
|
|
|
|
+the TeX system includes them as-is in the main PDF.
|
|
|
|
+As a result, several subsets of the same font are embedded
|
|
|
|
+in the main PDF. It is not possible to remove the duplicates
|
|
|
|
+since they are different subsets. This vastly increases
|
|
|
|
+the size of the main PDF file.
|
|
|
|
+
|
|
|
|
+On the other hand, if the small PDF files contain embedded
|
|
|
|
+full font sets, the TeX system also includes all of them
|
|
|
|
+in the main PDF. This time, the main PDF contains duplicates
|
|
|
|
+of the same full sets of fonts.
|
|
|
|
+Therefore, Ghostscript can remove the duplicates.
|
|
|
|
+This may considerably reduce the main PDF-file's size.
|
|
|
|
+#'
|
|
|
|
+
|
|
|
|
+Finally, if the small PDF files contain some fonts
|
|
|
|
+that are not embedded, the TeX system outputs the main PDF file
|
|
|
|
+with some fonts missing. In this case, Ghostscript can embed
|
|
|
|
+the necessary fonts. It can significantly reduce the required
|
|
|
|
+disk size.
|
|
|
|
+
|
|
|
|
+Either way, when Ghostscript reads the main PDF produced
|
|
|
|
+by the TeX system and outputs the final PDF it does not
|
|
|
|
+preserve PDF page-mode and named-destinations etc.
|
|
|
|
+As a result, when you open the final PDF, it is not displayed
|
|
|
|
+correctly. Also, remote PDF links will not work.
|
|
|
|
+
|
|
|
|
+This program is able to extract page mode and named destinations
|
|
|
|
+as PDFmark from PDF. By using this you can get the small PDF
|
|
|
|
+files that have preserved them.
|
|
|
|
+
|
|
|
|
+%description -l ja
|
|
|
|
+TeX のようなシステムを使って PDF のドキュメントを作る場合、
|
|
|
|
+図としてたくさんの小さな PDF を用意して、メインの PDF に
|
|
|
|
+貼り付けるようなことが行われます。このとき、図の PDF では
|
|
|
|
+同じフォントを使っていることが多いと思います。
|
|
|
|
+
|
|
|
|
+図の PDF にフォントのサブセットが埋め込まれていた場合、
|
|
|
|
+TeX システムはそのフォントをそのままメインの PDF に埋め込みます。
|
|
|
|
+結果として、メイン PDF には重複した同じフォントの異なる
|
|
|
|
+サブセットが埋め込まれます。サブセットが異なるため重複した
|
|
|
|
+フォントを削除することはできません。
|
|
|
|
+よってメイン PDF のファイルサイズは、かなり大きくなってしまいます。
|
|
|
|
+
|
|
|
|
+一方、図の PDF にフォントをフルセットで埋め込んだ場合、
|
|
|
|
+TeX システムはフルセットのフォントをメインの PDF へ埋め込みます。
|
|
|
|
+メイン PDF にはたくさんの重複したフォントが埋め込まれますが、
|
|
|
|
+すべて同じフルセットのフォントです。そのため、Ghostscript
|
|
|
|
+を使えば重複を削除することができ、これによってメイン PDF
|
|
|
|
+のサイズを低減することができます。
|
|
|
|
+
|
|
|
|
+さらに、図の PDF に一切フォントを埋め込まなかった場合、
|
|
|
|
+TeX システムはフォントが欠けたメイン PDF を出力します。
|
|
|
|
+この場合、Ghostscript は必要なフォントを埋め込むことができるので、
|
|
|
|
+必要なディスク容量を劇的に減らすことができるようになります。
|
|
|
|
+
|
|
|
|
+いずれの方法でも、Ghostscript へ TeX システムの出力した
|
|
|
|
+メイン PDF を入力し、最終的な PDF を出力することになります。
|
|
|
|
+しかし、残念ながら、この処理で Ghostscript は PDF のページモードや
|
|
|
|
+リンクの宛先名を残してくれません。そのため、最終的な PDF は
|
|
|
|
+意図したとおりに開かれなかったり、リモートからのリンクが機能
|
|
|
|
+しなくなったりしてしまいます。
|
|
|
|
+
|
|
|
|
+Extract PDFmark は PDF からページモードやリンクの宛先名を抽出し、
|
|
|
|
+PDFmark として保存することができます。このツールを使うと、
|
|
|
|
+ページモードやリンク先名を残したまま、サイズの小さい PDF を得る
|
|
|
|
+ことができます。
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+%prep
|
|
|
|
+%setup -q
|
|
|
|
+
|
|
|
|
+%build
|
|
|
|
+%configure
|
|
|
|
+%{__make} %{?_smp_mflags}
|
|
|
|
+
|
|
|
|
+%install
|
|
|
|
+%{__rm} -rf ${RPM_BUILD_ROOT}
|
|
|
|
+%makeinstall
|
|
|
|
+%{__rm} -rf ${RPM_BUILD_ROOT}%{_docdir}/%{name}
|
|
|
|
+
|
|
|
|
+%clean
|
|
|
|
+%{__rm} -rf ${RPM_BUILD_ROOT}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+%files
|
|
|
|
+%defattr(-,root,root)
|
|
|
|
+%doc COPYING README.ja.md README.md
|
|
|
|
+%{_bindir}/
|
|
|
|
+%{_mandir}/man1/
|
|
|
|
+
|
|
|
|
+%changelog
|
|
|
|
+* Thu Nov 30 2017 Toshiaki Ara <ara_t@384.jp> 1.0.2-2
|
|
|
|
+- correct Group
|
|
|
|
+
|
|
|
|
+* Thu Nov 30 2017 Toshiaki Ara <ara_t@384.jp> 1.0.2-1
|
|
|
|
+- initial build for Vine Linux
|
|
|
|
+
|