
답변1
다음은 많은 PDF에 대해 상대적으로 쉽게 스크립트를 작성할 수 있는 옵션입니다.
Inkscape에서 간단한 PDF 검은 별을 만들었습니다 star.pdf
.
다음을 사용하여 압축을 풀 수 있습니다 pdftk
.
pdftk star.pdf output star2.pdf uncompress
그런 다음 를 사용하여 검정색 채우기 및 획 설정 명령을 제거해 보겠습니다 sed
(이는 PDF가 RGB 검정색만 사용하고 형식이 다음과 같다고 가정합니다: 0 0 0 rg
및 0 0 0 RG
).
sed 's/0.0.0.[rR][gG]/ /g' < star2.pdf > star3.pdf
이제 star3.pdf
검정색 명령이 제거되었습니다.
다음은 샘플 테스트 TeX 파일입니다.
\documentclass{article}
\usepackage{xcolor}
\usepackage{graphicx}
\begin{document}
\includegraphics{star3.pdf}
\color{blue}
\includegraphics{star3.pdf}
\includegraphics{star.pdf}
\color{magenta}
\includegraphics{star3.pdf}
\end{document}