Move margintext in line with rest of text - formatting

I was wondering how to bring the names of the places of work on the left side in one line with the job titles and the date. E.g. Praktikum Psychologie should be in line with Sonnhalde Grüningen. See compilable code below. I've tried vspace etc. but haven't had much luck. Same issue with Ausbildung (Education) as well.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Classicthesis-Styled CV
% LaTeX Template
% Version 1.0 (22/2/13)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Alessandro Plasmati
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass{scrartcl}
\reversemarginpar % Move the margin to the left of the page
\newcommand{\MarginText}[1]{\marginpar{\raggedleft\itshape\small#1}} % New command defining the margin text style
\usepackage[nochapters]{classicthesis} % Use the classicthesis style for the style of the document
\usepackage[LabelsAligned]{currvita} % Use the currvita style for the layout of the document
\usepackage[ngerman]{babel}
\renewcommand{\cvheadingfont}{\LARGE\color{Purple}} % Font color of your name at the top
\usepackage{hyperref} % Required for adding links and customizing them
\hypersetup{colorlinks, breaklinks, urlcolor=Purple, linkcolor=Purple} % Set link colors
\usepackage{enumitem}% Use the enumitem package for lists - http://ctan.org/pkg/enumitem
\setlist{nolistsep}
\newlength{\datebox}\settowidth{\datebox}{Spring 2011} % Set the width of the date box in each block
\newcommand{\NewEntry}[3]{\noindent\hangindent=1em\hangafter=0 \parbox{\datebox}{#1}\hspace{0.1em} #2 #3 % Define a command for each new block - change spacing and font sizes here: #1 is the left margin, #2 is the italic date field and #3 is the position/employer/location field
\vspace{0.5em}} % Add some white space after each new entry
\newcommand{\Description}[1]{\noindent\hangindent=2em\hangafter=0\noindent\footnotesize{#1}\par\normalsize\vspace{1em}} % Define a command for descriptions of each entry - change spacing and font sizes here
\usepackage{adforn}
%----------------------------------------------------------------------------------------
\begin{document}
\thispagestyle{empty} % Stop the page count at the bottom of the first page
%----------------------------------------------------------------------------------------
% NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------
\begin{cv}{\spacedallcaps{censored}}\vspace{1.5em} % Your name
\spacedlowsmallcaps{Persönliche Daten}\vspace{0.5em} % Personal information heading
\datebox=1in
\NewEntry{\large{*}}{censored}{} % Birthplace and date
\datebox=1in
\NewEntry{e-mail}{\href{mailto:censored}{censored} % Email address
\datebox=1in
\NewEntry{telefon}{censored} % Phone number(s)
\datebox=1in
\NewEntry{adresse}{censored} % Address
\vspace{1em} % Extra white space between the personal information section and goal
%\noindent\spacedlowsmallcaps{Goal}\vspace{1em} % Goal heading, could be used for a quotation or short profile instead
%\Description{Improve my skills in creating and developing cutting edge projects. Find a way to apply scientific approaches in solving practical problems. }\vspace{2em} % Goal text
%----------------------------------------------------------------------------------------
% Experience
%----------------------------------------------------------------------------------------
\spacedlowsmallcaps{Berufserfahrung}\vspace{1em}
\datebox=3.2in
\datebox=3.2in
\NewEntry{Praktikum Psychologie}{\textit{08.2022 -- 02.2023}}
\Description{\MarginText{\textsc{\href{https://www.klinik-sonnhalde.ch/}{Sonnhalde}} \\ Grüningen.} \vspace{-2mm}
\begin{itemize}
\item Pensum 40-60 \%
\item Psychotherapiegespräche im Einzelsetting
\item Co-Leitung Sozialkompetenztraining
\item Leitung Gruppe Achtsamkeit
\item Begleitung Psychiater auf Visiten
\item regelmässige Teilhabe an Supervisionen
\end{itemize}}
\datebox=3.2in
\NewEntry{Praxisassistentin}{\textit{06.2019 -- 06.2022}}
\Description{\MarginText{\textsc{Zentrum für Chiropraktik} \\ Zürich.} \vspace{-2mm}
}
\vspace{2.25em} % Extra space between major sections
\datebox=3.2in
\NewEntry{Praktikum Psychologie}{\textit{10.2020 -- 01.2021}}
\Description{\MarginText{\textsc{\href{https://www.forio.ch/}{forio AG}} \\ Frauenfeld.} \vspace{-4mm}
\begin{itemize}
\item Mitarbeit Begutachtungen und Testberichte
\item selbstständige Durchführung psychodiagnostischer Testverfahren \\(\textsc{WISC-V}, \textsc{WAIS-IV}) mit Jugendlichen und Erwachsenen
\end{itemize}}
\datebox=3.2in
\NewEntry{Mitarbeiterin Hotellerie}{\textit{09.2016 -- 09.2019}}
\Description{\MarginText{\textsc{Privatklinik Hirslanden} \\ Zürich.} \vspace{-4mm}
}
\vspace{2.25em} % Extra space between major sections
\datebox=3.2in
\NewEntry{Diverse Praktika}{\textit{07.2015--08.2016}}
\Description{\MarginText{\textsc{} \\ } \vspace{-4mm}
}
\vspace{0.4em} % Extra space between major sections
------------
\vspace{0.4em} % Extra space between major sections
%----------------------------------------------------------------------------------------
% EDUCATION
%----------------------------------------------------------------------------------------
\spacedlowsmallcaps{Ausbildung}\vspace{1em}
\datebox=3.2in
\NewEntry{MSc Psychologie}{\textit{2020-2022}}
\Description{\MarginText{\textsc{UZH} \\ Zürich.}
\vspace{-4mm}
\begin{itemize}
\item Masterarbeit \\ \textit{Englisch als Lingua Franca und Machine Translation}
\end{itemize}}
\datebox=3.2in
\NewEntry{BSc Psychologie}{\textit{2016-2020}}
\Description{\MarginText{\textsc{UZH} \\ Zürich.}
\vspace{-4mm}
}
\datebox=3.2in
\NewEntry{Gymnasiale Maturität}{\textit{2009-2015}}
\Description{\MarginText{\textsc{Kantonsschule} \\ Wetzikon.}
\vspace{-4mm}
\begin{itemize}
\item Schwerpunktfach Spanisch
\end{itemize}
}
%------------------------------------------------
%------------------------------------------------
%------------------------------------------------
%----------------------------------------------------------------------------------------
% OTHER INFORMATION
%----------------------------------------------------------------------------------------
\vspace{1em} % Extra space between major sections
\spacedlowsmallcaps{Verschiedenes}\vspace{1em}
\Description{seit 2017 \ \ ~ $\cdotp$\ \ Vorstand Samariterverein Grüningen}
\vspace{-0.5em} % Negative vertical space to counteract the vertical space between every \Description command
\Description{~~~~~~~~~~~~~~~ \ \ $\cdotp$\ \ Mitglied Verein \href{https://www.njira.org/}{Njira}}
\vspace{-0.5em} % Negative vertical space to counteract the vertical space between every \Description command
\newpage
%------------------------------------------------
%----------------------------------------------------------------------------------------
% COMPUTER SKILLS
%----------------------------------------------------------------------------------------
\spacedlowsmallcaps{Software}\vspace{1em}
\Description{\MarginText{Ausgezeichnet}Microsoft Office Word \& Excel}
\Description{\MarginText{Fortgeschritten} R, \LaTeX, SDL Trados Studio, Adobe Illustrator \& InDesign}
%------------------------------------------------
\vspace{0.8em}
\spacedlowsmallcaps{Sonstiges}\vspace{1em}
\newlength{\langbox} % Create a new length for the length of languages to keep them equally spaced
\settowidth{\langbox}{Französisch} % Length equals the length of "English" - if you have a longer language in your list put it here
\Description{\MarginText{Sprachen}\parbox{\langbox}{\textsc{Deutsch}}\ \ $\cdotp$\ \ \ Muttersprache}
\vspace{-0.5em} % Negative vertical space to counteract the vertical space between every \Description command
\Description{\parbox{\langbox}{\textsc{Englisch}}\ \ $\cdotp$\ \ \ Muttersprache}
\vspace{-0.5em} % Negative vertical space to counteract the vertical space between every \Description command
\Description{\parbox{\langbox}{\textsc{Französisch}}\ \ $\cdotp$\ \ \ B1}
\vspace{-0.5em} % Negative vertical space to counteract the vertical space between every \Description command
\Description{\parbox{\langbox}{\textsc{Russisch}}\ \ $\cdotp$\ \ \ A2}
\vspace{1em} % Negative vertical space to counteract the vertical space between every \Description command
%------------------------------------------------
\Description{\MarginText{Interessen}Fussball\ \ $\cdotp$\ \ Schwimmen \ \ $\cdotp$\ \ Sprache \& Geschichte \ \ $\cdotp$\ \ Typografie \& Drucksatz}
%----------------------------------------------------------------------------------------
\end{cv}
\end{document}

Related

Convert PDF/Images to a flip based effect in GIF

I want to convert a PDF or sequence-of-images to a flip based effect in GIF (similar to the one below).
Is there any softwares available handy I could use to produce this output? or do I have to write scripts using imageMagicK? please suggest?
Thanks in advance!
Cool project! This isn't production-ready, military-hardened, bullet-proof code, but the following will do most of the heavy lifting as regards getting set up, appending the individual pages, distorting pages as they turn and finally putting the whole lot together in an animated GIF sequence.
#!/bin/bash
################################################################################
# flipbook
# Mark Setchell
#
# Give me 4 pages as parameters and I create an animated GIF book out of them
# called book.gif.
#
# Requires ImageMagick
################################################################################
# Names of the 4 pages
p0=${1:-page0.gif} # Use first arg, or "page-0.gif" if none given
p1=${2:-page1.gif}
p2=${3:-page2.gif}
p3=${4:-page3.gif}
# Get width and height of images - I assume, but do not check all are identical sizes
read w h < <(convert "$p0" -format "%w %h" info: )
((twow=w+w))
# Layout first and last flat double-page spreads
convert "$p0" "$p1" +append frame0.png
convert "$p2" "$p3" +append frame4.png
# Make right page taller and thinner and save as "distorted.png"
((deltah=20*h/100))
((deltaw=20*w/100))
((hplusdeltah=h+deltah))
((wminusdeltaw=w-deltaw))
((hplus2deltah=h+deltah+deltah))
points="0,0 0,$deltah $wminusdeltaw,0 $wminusdeltaw,0 $wminusdeltaw,$hplus2deltah $wminusdeltaw,$hplus2deltah 0,$hplus2deltah 0,$hplusdeltah"
convert "$p1" +matte -virtual-pixel transparent \
-resize ${wminusdeltaw}x${hplus2deltah}! +repage \
-distort Perspective "$points" +repage distorted.png
# Make second frame by overlaying distorted right page ontop of pages 0 and 3
convert "$p0" "$p3" +append \
-bordercolor white -border 0x$deltah \
+repage \
distorted.png \
-geometry +${w}x \
-composite frame1.png
# Make left page taller and thinner and save as "distorted.png"
((deltaw=70*w/100))
((wminusdeltaw=w-deltaw))
points="0,0 0,0 $wminusdeltaw,0 $wminusdeltaw,$deltah $wminusdeltaw,$hplus2deltah $wminusdeltaw,$hplusdeltah 0,$hplus2deltah 0,$hplus2deltah"
convert "$p2" +matte -virtual-pixel transparent \
-resize ${wminusdeltaw}x${hplus2deltah}! +repage \
-distort Perspective "$points" +repage distorted.png
# Make third frame by overlaying distorted left page ontop of pages 0 and 3
convert "$p0" "$p3" +append \
-bordercolor white -border 0x$deltah \
+repage \
distorted.png \
-geometry +${deltaw}x \
-composite frame2.png
# Make left page taller and thinner and save as "distorted.png"
((deltaw=20*w/100))
((wminusdeltaw=w-deltaw))
points="0,0 0,0 $wminusdeltaw,0 $wminusdeltaw,$deltah $wminusdeltaw,$hplus2deltah $wminusdeltaw,$hplusdeltah 0,$hplus2deltah 0,$hplus2deltah"
convert "$p2" +matte -virtual-pixel transparent \
-resize ${wminusdeltaw}x${hplus2deltah}! +repage \
-distort Perspective "$points" +repage distorted.png
# Make fourth frame by overlaying distorted right page ontop of pages 0 and 3
convert "$p0" "$p3" +append \
-bordercolor white -border 0x$deltah \
+repage \
distorted.png \
-geometry +${deltaw}x \
-composite frame3.png
# Make final animation from frame0.png...frame4.png
convert -gravity center -delay 100 frame*.png -background white -extent ${twow}x${hplus2deltah} book.gif
So, if you start with the following as page0.gif, page1.gif, page2.gif and page3.gif...
You will get this as book.gif
If your book has more than 4 pages, you can do four at a time and then append the animations quite simply.
Updated Answer
It seems you are unfortunate enough to have to use Windows - which is very cumbersome in BATCH. I am no expert, but can get around in BATCH a little. I think the script above is pretty easy to translate though. I'll get you started but you will need to do some yourself - you can always ask a new question if you get stuck - questions are free!
The first part of the script just picks up the parameters supplied on the command line, so it'll look like this:
REM Pick up commandline parameters
set p0=%1
set p1=%2
set p2=%3
set p3=%4
Then we need to work out the width and height of the input images, something like this:
REM Get width and height of images in variable "w" and "h"
FOR /F %%A IN ('identify -format "w=%%w\nh=%%h" %p0%') DO set %%A
All the stuff in my original script inside ((..)) is just simple maths which can be done in BATCH using SET /A, so the lines that look like this:
((twow=w+w))
((deltah=20*h/100))
will look like this:
SET /A TWOW=w+w
SET /A DELTAH=20*h/100
The rest is just convert commands - you will need to do a couple of things there:
Replace line continuations at ends of lines, so change \ to ^
Where I use $variable or ${variable}, replace it with %variable%
Double any % signs I have, so % becomes %%
Change \( to ^( - I think
change any single quotes ' to double quotes "
Best to just work through it and see what happens as you convert each line and ask another question if you can't work it out.
There is some good info at these places - ss64 - general, ss64 - set command on BATCH in general. Also, an English guy called Alan Gibson, uses IM with Windows very competently and you can see his scripts here, and also more generally here for inspiration on how to be effective with IM under Windows.

Ghostscript renders ugly text

I'm trying to add the capability to render LaTeX equations to a project I'm working on. To do so, I use XeLaTeX to create a PDF file, which I then render to a (transparent) 96dpi-PNG using Ghostscript.
I'd like to have the rendered LaTeX blend in with the rest of the text (which is rendered using standard .NET GDI+ methods, but that's off-topic), but I can't get a reliably "good" text rendering: the output always looks somehow blurry or otherwise "bad".
Example:
From left to right, the same (small) PDF rendered at 96dpi with Ghostscript, Photoshop, and TexWorks (which I understand uses Ghostscript internally).
The command I use to run Ghostscript is the following:
"C:/Program Files (x86)/gs/gs9.09/bin/gswin32c.exe" \
-q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT \
-dMaxBitmap=500000000 -dAlignToPixels=1 -dGridFitTT=2 \
"-sDEVICE=pngalpha" -dTextAlphaBits=4 \
-dGraphicsAlphaBits=4 "-r96" -dFirstPage=1 -dLastPage=1 \
-sOutputFile="output.png" "input.pdf"
(which I actually pretty much copied from the command ImageMagick calls when converting a PDF file, but that's another story). I tried changing any of the relevant options (dAlignToPixels=0, dGridFitTT=0/1/2, dTextAlphaBits=2/4 [or without this parameter altogether]) and I even tried to render the PDF to 4 times the resolution and then downscale it, without any noticeable improvement.
Yet, I'm sure there must be some way of decently rendering the PDF with Ghostscript (since TexWorks does), although I'm unable to find it.
Any hint? The PDF is this one.
You could try to render your PDF at a higher resolution. 96dpi just isn't enough for text with 11 pt size.
If you use 192dpi and then scale the display of the resulting image to 50% (wherever you use the PNG), these parts should still appear in the same size as befor, but with a higher resolution. What used to be a 4x7 pixels 's' should now be a 8x14 pixels 's'...
Update
Ok, since my explanation seems to have been not comprehendible enough for the OP, here's the deal.
Generate a PDF file containing the word "Test", using Ghostscript. In my case, it is Ghostscript v9.10:
gs \
-o test.pdf \
-sDEVICE=pdfwrite \
-g230x100 \
-c "/Helvetica findfont \
11 scalefont \
setfont \
1 1 moveto \
(Test) show \
showpage"
From this PDF, generate 6 different images depicting the word "Test", using 6 different resolutions. The gs is still Ghostscript v9.10 (to be checked with gs -version):
for i in 1 2 3 4 5 6; do \
gs \
-o t$(( ${i} * 96 )).png \
-r$(( ${i} * 96 )) \
-sDEVICE=pngalpha \
-dAlignToPixels=1 \
-dGridFitTT=2 \
-dTextAlphaBits=4 \
-dGraphicsAlphaBits=4 \
t.pdf ; \
done
This will create the following PNGs, as confirmed by ImageMagick's identify command:
identify -format "%f : %Wx%H pixels -- %b filesize\n" t[1-9]*.png
t96.png : 31x13 pixels -- 475B filesize
t192.png : 61x27 pixels -- 774B filesize
t288.png : 92x40 pixels -- 1.1KB filesize
t384.png : 123x53 pixels -- 1.43KB filesize
t480.png : 153x67 pixels -- 1.76KB filesize
t576.png : 184x80 pixels -- 2.01KB filesize
Create a sample LaTeX document and embed the different images side by side and/or line by line. Here is my sample code:
\begin{document}
Test
\includegraphics[height=7.5pt]{t96.png}
\includegraphics[height=7.5pt]{t96.png}
\includegraphics[height=7.5pt]{t192.png}
\includegraphics[height=7.5pt]{t288.png}
\includegraphics[height=7.5pt]{t384.png}
\includegraphics[height=7.5pt]{t480.png}
\includegraphics[height=7.5pt]{t576.png}
Test\\
{}
Test <== real text
\includegraphics[height=7.5pt]{t96.png} <-- 96 dpi figure
\includegraphics[height=7.5pt]{t192.png} <-- 192 dpi figure
\includegraphics[height=7.5pt]{t288.png} <-- 288 dpi figure
\includegraphics[height=7.5pt]{t384.png} <-- 384 dpi figure
\includegraphics[height=7.5pt]{t480.png} <-- 480 dpi figure
\includegraphics[height=7.5pt]{t576.png} <-- 576 dpi figure
Test <== real text
\end{document}
Here is a screenshot (at 400% zoom) from the PDF created via LuaLaTeX from the above LaTeX code:
The line with the 8 "Test" words has actual text only in the first and the last word. The 6 words in between are images with 96, 96, 192, 288, 384, 480 and 576 dpi.
I hope you can see now clearly how scaling up your image generation to a higher resolution will result in better quality for your final PDF if you include the higher resolution images into your LaTeX code...
You are rendering text at 11 points, at 96 dpi, that works out to about 14 pixels in height which, frankly, is not a lot (and in my output the 's' is 7 pixels high by 4 wide). Looking at your output all 3 look 'blurry' and the Photoshop output looks overly bold in the capital T.
If you don't want it blurred, then don't set TextAlphaBits, or don't set it to such a high value.
I'd also suggest using the current release (9.15).

How to adjust BoundingBox of an EPS file?

I want to crop main area of a PS or PDF file to create an EPS file without white space. Commands of ghostrcipt, ps2pdf, epstools can crop the main drawing out of the document file.
The problem is that they only crop in its original form, but I want to create an EPS file with BoundingBox 0 0 x y; cropped and moved to the bottom left corner.
The difference i when we want to insert the resulting EPS file inside a PS document. When having BoundingBox x0 y0 x y, the PS document inserts the EPS file at point x0 y0, instead of where we are.
EXAMPLE:
Consider a simple PS file as
%!
/Times-Roman findfont
11 scalefont setfont
72 700 moveto
(This is a test)show
if converting it to EPS with a command like
ps2eps test.ps test.eps
It will produce
%!PS-Adobe-2.0 EPSF-2.0
%%BoundingBox: 72 700 127 708
%%HiResBoundingBox: 72.000000 700.000000 127.000000 707.500000
%%EndComments
% EPSF created by ps2eps 1.68
%%BeginProlog
save
countdictstack
mark
newpath
/showpage {} def
/setpagedevice {pop} def
%%EndProlog
%%Page 1 1
/Times-Roman findfont
11 scalefont setfont
72 700 moveto
(This is a test)show
%%Trailer
cleartomark
countdictstack
exch sub { end } repeat
restore
%%EOF
It has been cropped in its original coordinates, and the resulting BoundingBox is 72 700 127 708. Now if trying to insert this EPS file within a PS document, it tries to nest at this coordinate.
It will be useful if creating an EPS file with BoundingBox: 0 0 55 8. Of course, all drawing coordinates (here moveto) must be modified with this new reference.
NOTE: As stated, my purpose from fixing the BoundingBox reference point is to make it importable within PS document. Thus, an alternative answer to this question is: how to insert an EPS file inside PS document regardless of its BoundingBox.
For example, how to insert this EPS file at location 200 200 255 208 of a PS document. I try to insert the EPS with the following code, but it will not work unless the BoundingBox is started from 0 0:
200 200 translate
save
/showpage {} bind def
(test.eps)run
restore
What about simply un-translating?
-72 -700 translate
Either in the eps itself, or in the prep section before the inclusion?
AWKward!
The following typescript illustrates an awk script which performs the desired modifications
to the eps, guided by the DSC comments (just like Mama used to do!).
The advantage is: if you can guarantee that the input EPS conforms sufficiently to DSC to provide these markers, this approach will be orders-of-magnitude faster than passing the file through ghostscript.
Simplicity is both the advantage and the limitation of this program. It scans for DSC comments, extracts values from the BoundingBox comment, suppresses the HiResBoundingBox, and adds postscript 'translate' and 'rectclip' commnds just after the Page comment. This should produce the correct results so long as the EPS really is bona-fide. But the ghostscript approach in the other answer will produce results on input files with less reliable DSC-conformance (because it's not taking shortcuts, it treats DSC as comments and completely ignores them).
Strictly speaking the 'rectclip' shouldn't be necessary, but the question asks that the output be "cropped".
592(1)11:27 AM:~ 0> cat epscrop.awk
/%%BoundingBox: ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*)/{x=$2;y=$3;w=$4-x;h=$5-y;print $1,0,0,w,h}
!/%%BoundingBox:/&&!/%%HiRes/{print}
/%%Page /{print -x,-y,"translate"; print 0,0,w,h,"rectclip"}
593(1)11:27 AM:~ 0> awk -f epscrop.awk etest.eps
%!PS-Adobe-2.0 EPSF-2.0
%%BoundingBox: 0 0 55 8
%%EndComments
% EPSF created by ps2eps 1.68
%%BeginProlog
save
countdictstack
mark
newpath
/showpage {} def
/setpagedevice {pop} def
%%EndProlog
%%Page 1 1
-72 -700 translate
0 0 55 8 rectclip
/Times-Roman findfont
11 scalefont setfont
72 700 moveto
(This is a test)show
%%Trailer
cleartomark
countdictstack
exch sub { end } repeat
restore
%%EOF
To convert it to an EPS with the BoundingBox-style you want, I would use Ghostscript and let the EPS make a roundtrip: EPS => PDF => EPS.
The trick is to ensure that the PDF uses a media size that is the same as the BoundingBox width and height are by adding the -dEPSCrop param.
These two commands create your 'EPS without white space':
1st step: convert EPS to PDF:
gs \
-o so#12682621.pdf \
-sDEVICE=pdfwrite \
-dEPSCrop \
so#12682621.eps
2nd step: convert PDF back to EPS:
gs \
-o so#12682621.roundtripped.eps \
-sDEVICE=epswrite \
so#12682621.pdf
To test the fidelity of your resulting EPS, you could use ImageMagick's compare to show the differences, pixel-wise in red, as a PNG file:
compare \
-density 600 \
12682621.roundtripped.eps \
12682621.eps \
-compose src \
12682621.png
which results in:
You'll notice that there are some pixel differences. They are caused by the value of 707.500000 from the %%HiResBoundingBox, which leads to a rounding error later on (PNG can't have 'half pixels').

Need to remove a bunch of white space on PDFs?

I have around 100 PDF files (each 1-3 pages long) that are formatted strangely, and I need to fix them. The problem is that there's a ton of white space at the top of almost all of them. I have Acrobat X Pro.
For example: http://imageshack.us/a/img195/510/ex1w.png
Download example: http://www.sendspace.com/file/2hohj5
I've tried selecting the text with the "Move or make changes to objects tool" and shifting it up, but there's a white box in the way that covers the text. If I delete the box, there's more text under it that I can't have.
I'm very confused. If this question isn't making sense please download the pdf and try for yourself.
Another example (across multiple pages this time): http://imageshack.us/a/img337/3714/ex2v.png
Download example: http://www.sendspace.com/file/q7dmnl
You can use Ghostscript to cut off content from pages and reduce the page height. Try this:
gs \
-o out.pdf \
-sDEVICE=pdfwrite \
-g6120x5000 \
2hohj5.pdf
Result of 1st page cropped (as PNG, scaled down):
Alternatively, you can use Ghostscript to shift the contents of each page up by, say 3 inches ( == 216 points) without changing the page sizes:
gs \
-o out2.pdf \
-sDEVICE=pdfwrite \
-c "<</Install {0 216 translate}>> setpagedevice" \
-f 2hohj5.pdf
Result of 1st page, content shifted upward by 3 inches (scaled PNG):

Paperclip/ImageMagick problems on Windows

I managed to implement a rounded-corners post-process on my avatars. It works fine on my Mac, but no dice on Windows.
it looks like so
def self.convert_options(px = 10)
trans = ""
trans << " \\( +clone -alpha extract "
trans << "-draw 'fill black polygon 0,0 0,#{px} #{px},0 fill white circle #{px},#{px} #{px},0' "
trans << "\\( +clone -flip \\) -compose Multiply -composite "
trans << "\\( +clone -flop \\) -compose Multiply -composite "
trans << "\\) -alpha off -compose CopyOpacity -composite "
end
based on http://www.imagemagick.org/Usage/thumbnails/#rounded & Rounded corners with Paperclip
The big list of errors I got kicked off with
convert.exe: unable to open image `\\(': No such file or directory # error/blob.c/OpenBlob/2638.
I figure maybe it is something to do with Windows escaping characters? So changed the \ to ^ but got this error instead
convert.exe: unable to open image `black': No such file or directory # error/blob.c/OpenBlob/2638.
ImageMagick is working, otherwise. It manages simpler processing/resizing fine. And the line produces rounded corner files with no problem if I use GIT BASH to type out the command straight into the shell.
A good night's sleep (after hours of trying thousands of combinations) led me to this
def self.convert_options_win(px = 10)
trans = " "
trans << " ( +clone -alpha extract -draw \"fill black polygon 0,0 0,#{px} #{px},0 fill white circle #{px},#{px} #{px},0 \" "
trans << " ( +clone -flip ) -compose Multiply -composite "
trans << " ( +clone -flop ) -compose Multiply -composite ) "
trans << " -alpha off -compose CopyOpacity -composite "
end
which works fine. No real need for the continuation characters at the start of the line, as it was all being truncated into a single line string. Windows shell prefers "double quotes" to 'single quotes' so just had to escape those within the string. I tried so many combinations, can't believe it was this simple.