TransWikia.com

How to paste the book cover in a printer's template?

TeX - LaTeX Asked by morpheus on January 4, 2021

I am designing a book cover in latex. However I need to be able to paste it into a template given to me by the publisher. The template is a PDF file that looks like below. I need to paste my cover in the highlighted box. That is the first problem. The second problem is that I don’t want to occlude the barcode in the template as I paste over my book cover. Is this possible with the latex toolchain? How? Otherwise what are my options? Thank you so much.

enter image description here

One Answer

This is the bare minimum to get it setup. The rest depends on how you're building the cover.

For example in this example code, I've placed the template.png in the same folder, loaded it up, set the paperwidth/paperheight to the same dimensions as the .png and forced the same to keep the dimensions (as you see in the same template).

Right now the image is in the background, you can write on top with regular text. If you want to place elements you could try something like tikz (see solution #2). I personally find it easier to place a grid on top of the background and use it to easily find coordinates and move elements on top. But it's just one approach and it depends on what you need to do and what you prefer to use.

Method with the background package

enter image description here

documentclass{article}
usepackage[paperwidth=483mm, paperheight=305mm, margin=0cm]{geometry}
usepackage[scale=1,angle=0,opacity=1]{background}
usepackage{graphicx}
usepackage{lipsum}% to create fake text

pagestyle{empty}

begin{document}noindent%
backgroundsetup{%
    contents={includegraphics[width=483mm, keepaspectratio]{template.png}}}%
lipsum[1-4]% example text
end{document}

Alternative method with tikz

enter image description here

documentclass{article}
usepackage[paperwidth=483mm, paperheight=305mm, margin=0cm]{geometry}
usepackage{graphicx, lipsum}
usepackage{tikz}

pagestyle{empty}

begin{document}noindent
begin{tikzpicture}[remember picture, overlay]
    node[anchor=south west] at (current page.south west) {%
        includegraphics[width=483mm, keepaspectratio]{template.png}};
    draw[step=1cm,gray] (current page.south west) grid (current page.north east); 
end{tikzpicture}
end{document}

Correct answer by Alenanno on January 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP