[]'s
LEo
You should be able to do it with the pdfpages package.
I think something like this should work (totally untested)
\documentclass{article}
\usepackage{pdfpages}
\usepackage[a5paper]{geometry}
\begin{document}
\includepdf[pages=-]{a4document.pdf}
\end{document}
You might need a scale=0.7071 in there as well...
Hope this helps,
Will
I think you're using the wrong options. If you look at the manpage
for psresize, it says that the "-P" switch specifies the *input* paper
size, and the "-p" switch specifies the desired *output* size. In
your case, if you modify the command to:
$ psresize -Pa4 -pa5 a4documen.ps a5document.ps
it should work. I just tried converting a letter document to a5, and
the result was a properly scaled A5 document.
There's also an example at the bottom of the manpage.
if you're interested in a command line solution:
> psresize -Pa4 -Pa5 a4documen.ps a5document.ps
you meant -pa5, right? (btw, you can omit the -Pa4, since this is the
default).
> %%DocumentPaperSizes: a5
It's indeed strange that psresize doesn't set this value. A call of
ps2ps will "correct" your file.
However, that's not really necessary: Simply *add* the statement above
to your PostScript file, and you're done.
Kai
> It's indeed strange that psresize doesn't set this value.
Yes, it is strange. That is so bogus of psresize. :( Somebody should have
fixed that a long time ago. Also, the BoundingBox line should be changed to
reflect A5 values:
%%BoundingBox: 0 0 421 595
Mike Shell
[]'s
LEo
On Dec 11, 1:37 pm, Michael Shell <ne...@michaelshell.org> wrote:
> On Tue, 11 Dec 2007 01:52:53 -0800 (PST)
>
You said that the content itself is resized correctly; the page size
itself is set by "DocumentPaperSizes" (and, as Michael pointed out,
the BoundingBox should be valid, too).
Any postscript viewer should respect this information. GhostView, for
example, does.
Is it that your .ps viewing software displays a different paper size?
Or why do you think the paper is still A4?
Kai
For future reference, here's the procedure I used to convert PDF A4 to
PDF A5.
To get/extract/convert PostScript from PDF, there are only two real
options that retain vector form:
1. Print to file in Acrobat reader, but sure and set the
correct output page size and perhaps deselect any
fit to page options. Note it gives you the option to
select pages, hence the ability to extract a single page.
2. xpdf's pdftops utility. It is available for both Unix and
Windows. For Windows, see the files in the binary releases
section: http://www.foolabs.com/xpdf/download.html
For Unix, its part of the xpdf package. pdftops also
allows you to select pages and gives you control of ps
output levels (1,2,3).
pdftops -paper A4 file_a4.pdf file_a4_pdftops.ps
psresize -Pa4 -pa5 file_a4_pdftops.ps file_a5.ps
now, edit file_a5.ps and
1. delete the %%DocumentMedia line
2. change the %%BoundingBox: line to:
%%BoundingBox: 0 0 421 595
%%DocumentPaperSizes: a5
%%BeginPaperSize: a5
gv then sees it as A5. OK.
Now, convert back to A5 PDF using Ghostscript:
gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a5 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=file_a5.pdf file_a5.ps
The file sizes of my example were:
5930528 file_a4.pdf
25379065 file_a4_pdftops.ps
25454901 file_a5.ps
4720291 file_a5.pdf
Cheers,
Mike Shell
> pdftops -paper A4 file_a4.pdf file_a4_pdftops.ps
>
> psresize -Pa4 -pa5 file_a4_pdftops.ps file_a5.ps
>
You can use the options -paperw and -paperh to pdftops to scale
the pages and convert back to pdf with pdf2ps. Then you don't
need to edit the PostScript file manually.
Of course, select a PostScript printer for this. Install a driver for
one if your own printer is not PS, and set it to print to file as
default.
Google around for suitable printer choices.
Dan
> You can use the options -paperw and -paperh to pdftops to scale
> the pages and convert back to pdf with pdf2ps. Then you don't
> need to edit the PostScript file manually.
Good one. The problem with Acrobat Reader, at least the early
versions, is that it would always shrink if scaling took
place, even if printing to the same size paper. Thus, margins
always seemed to grow. I'm glad that pdftops is more sane in this
regard.
pdftops -paperw 421 -paperh 595 file_a4.pdf file_a5_pdftopswh.ps
did the trick with file sizes:
25379305 file_a5_pdftopswh.ps
4737394 file_a5_pdftopswh.pdf
My version of gv does not automatically see it as A5, but
selecting A5 yields what appears to be the correct margins. So,
one may still have to edit the .ps to get gv to automatically
see the correct size if this hasn't been addressed in newer
releases. Also, I should mention that pdftops seems to generate
a .ps file with a first page number of 0, but after gs makes
a pdf from it, the numbering starts with 1.
Mike