janheinrichmerker / latex-postage

📄 Franking letters with »Deutsche Post«'s online postage service »Internetmarke«.
https://ctan.org/pkg/postage
MIT License
8 stars 2 forks source link

Usage examples #8

Open sephalon opened 3 years ago

sephalon commented 3 years ago

Do you have any examples on how to use this package with a letter document class like dinbrief or scrlttr2? I would be mostly interested in how to properly align the stamp in scrlttr2 to fit into a DIN lang envelope.

sephalon commented 3 years ago

After unsuccessfully messing around with scrlttr2s addrfield=backgroundimage option, I realized that the most straightforward solution seems to be to prepend the stamp to the recipient parameter:

\documentclass[version=last]{scrlttr2}
\usepackage[ngerman]{babel}
\usepackage{postage}
\begin{document}
\setkomavar{fromname}{Peter Musterfrau}
\setkomavar{fromaddress}{Hinter dem Tal 2\\
                         54321 Musterheim}
\begin{letter}{%
    {\centering\includestamp[compact]{sample-stamps}\par}
    Petra Mustermann\\
    Vor dem Berg 1\\
    12345 Musterhausen%
  }
\opening{Liebe Vereinsvorsitzende,}
\end{letter}
\end{document}

The result looks very similar to what you get if you add sender/recipient information in the Deutsche Post web app and select "Ausdruck 2-spaltig (DIN A4)" as output format.

How about adding this as an example to the package? Or do you know of a better way to include the stamp in scrlttr2?

sephalon commented 2 years ago

Any interest in adding such an example?