I'm converting EPS to PDF via Ghostscript's ps2pdf.bat
in Windows.
But the author of PDFs are my system name. I changed my user name from Windows, but when I look at the properties of the PDF, my name is there. How can I remove it?
[Tex/LaTex] Removing Author name in ps2pdf
ps2pdf
Related Solutions
JPEG, PNG and PDF are directly supported by PDF format, then they're supported by xdvipdfmx
directly. xetex
program reads the image files to determine the bounding boxes and produce a .xdv
file, then xdvipdfmx
program put the image data to PDF output file.
PDF format does not support PostScript stream, thus EPS files are converted to PDF format and then put into PDF output file. xdvipdfmx
calls GhostScript to do the trick.
PSTricks pacakge also calls GhostScript to render the PostScript code. The code needed is in xdvipdfmx.con
. Herbert may give more explanations.
If your objective is
- to get a standalone PDF output without excessive white spaces surrounding it, and
- to import the resulting PDF from within your main (La)TeX input file
then the remaining paragraphs might be useful for you.
In this answer, I assume you are a Windows user. If it is not the case, you have to adapt the given MS-DOS batch files (also known as make file in other OS).
WARNING: I also assume that the TeX input file, that is used to produce the standalone PDF output, does not load
animate
package. Why? Because the animation in the standalone PDF output will NO LONGER work when it is imported into your main TeX file by using either\includepdf{}
or\includegraphics{}
.
I will use the following image in this answer, name it hen.jpg
.
I will divide into 2 cases based on whether or not an input file, that is used to produce a standalone PDF output, imports images. If you don't import images in the input file, that is used to produce a standalone PDF output, then the division is not important but you should choose the faster one!
Case 1
This compilation is much much faster than the compilation that will be discussed in Case 2. However, you cannot use this work flow if your input file imports any image of type PDF, PNG and/or JPG. If you only import EPS images or you don't import any image, you should choose this work flow because the compilation is much much much faster!
Create a batch file, name it DevLa.bat
, to compile an input file that is used to produce a standalone PDF output.
rem It takes an input file name WITHOUT extension.
echo off
del %1.pdf
rem latex %1
latex %1
dvips -D10000 -t unknown %1
gswin32c -r10000 -dCompatibilityLevel=1.5 -dAutoRotatePages=/None -dPDFSETTINGS=/prepress -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%1.pdf %1.ps
del %1.log
del %1.aux
del %1.dvi
del %1.ps
For simplicity, you can save it in the same directory in which the input file exists. If you want to reuse this batch for other project, then you need to setup PATH environment variable.
The following MWE withoutimage.tex
(which does not import images) can be compiled with DevLa.bat
% withoutimage.tex
\documentclass{article}
\usepackage{pstricks,multido}
\SpecialCoor
\psset
{
linecolor=red,
arrows=->,
arrowscale=1.5 0.75
}
\usepackage[active,tightpage]{preview}
\PreviewBorder=0pt
\PreviewEnvironment{pspicture}
\begin{document}
\begin{pspicture}(-2,-2)(2,2)
\psframe[linecolor=red](-2,-2)(2,2)
\multido{\i=0+30}{12}
{%
\psline(0.9;\i)
\uput{1}[\i]{\i}(0,0){$\i^\circ$}%
}
\end{pspicture}
\end{document}
by invoking
DevLa withoutimage
And you will get a tight PDF output as follows.
Case 2
This compilation is much much slower than the compilation discussed in Case 1. However, you can use this work flow if your input file imports any image of type PDF, PNG, JPG and/or EPS. If you only import EPS images or you don't import any image, you should choose the work flow in Case 1 because its compilation is much much much faster!
Create a batch file, name it DevXe.bat
, to compile an input file that is used to produce a standalone PDF output.
rem It takes an input file name WITHOUT extension.
echo off
del %1.pdf
rem xelatex %1
xelatex %1
del %1.log
del %1.aux
For simplicity, you can save it in the same directory in which the input file exists. If you want to reuse this batch for other project, then you need to setup PATH environment variable.
The following MWE withimage.tex
(which does import a JPG image) can be compiled with DevXe.bat
% withimage.tex
\documentclass{article}
\usepackage{graphicx}
\usepackage{pstricks,multido}
\SpecialCoor
\psset
{
linecolor=red,
arrows=->,
arrowscale=1.5 0.75
}
\usepackage[active,tightpage]{preview}
\PreviewBorder=0pt
\PreviewEnvironment{pspicture}
\begin{document}
\begin{pspicture}(-2,-2)(2,2)
\psframe[linecolor=red](-2,-2)(2,2)
\multido{\i=0+30}{12}
{%
\psline(0.9;\i)
\uput{1}[\i]{\i}(0,0){\includegraphics[scale=0.1]{hen}}% please adapt it!
}
\end{pspicture}
\end{document}
DevXe withimage
And you will get a tight PDF output as follows.
Importing the stadalone PDF outputs
After getting the standalone PDF outputs, you can import them from within your main input file as follows.
% main.tex
\documentclass{article}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{figure}[hbtp]
\centering
\includegraphics[width=0.75\linewidth]{withoutimage}
\caption{This is a nice image.}
\end{figure}
\lipsum[2]
\begin{figure}[hbtp]
\centering
\includegraphics[scale=1.5]{withimage}
\caption{This is a nice image too.}
\end{figure}
\lipsum[3]
\end{document}
And it can be compiled using either xelatex
or pdflatex
.
If the
main.tex
still have other PSTricks codes with labels, then usexelatex
becausepdflatex
withauto-pst-pdf
will break the labels.
And the result is as follows.
Best Answer
I would suggest
exiftool
for this purpose; as far as I know it is the only free tool that can manipulate not only InfoDictionary, but also XMP metadata and provides a very convenient interface.To just clear the author field:
To get rid of all metadata:
Note, however, that
exiftool
does not really delete the metadata in the InfoDictionary, but just updates it with a newer version. In fact, you could restore the original data with:To really remove confidential data, you should remove all metadata with
exiftool
(which removes the XMP metadata and also the reference to the InfoDictionary) and then use a size optimizing tool that removes unreferenced objects from the PDF to get rid of the still present InfoDictonary. I frequently useqpdf
for this purpose:The result is, as far as I know, a truly metadata-free PDF.
Some background on PDF metadata
PDF metadata comes in two forms:
(a) The "classical" InfoDictionary, which contains a limited number of key/value pairs. This is the kind of metadata also written by
pdflatex
; thehyperref
package provides a convenient interface to set certain values of this metadata.(b) The newer XMP packets, which contain RDF data streams (an XML description), which so far is mostly used by Adobe Products (Acrobat since version 5.0). Whenever you edit a PDF file in Acrobat (probably also any other Adobe products) it silently creates the XMP metadata set and initializes it with values from the InfoDictionary. Afterwards, only the XMP metadata is used. So it is important to remove the XMP metadata as well.