--Apple-Mail=_D752F860-1A6B-493C-9961-F0085A044CA4
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
Oups,
J’avais oublié gun paramètre dans la ligne de commande :
sed -e "s/{CRITERE1}/${VarCRITERE1}/" -e "s/{CRITERE2}/${VarCRITERE2}/" \
-e […] "${FicModeleMD}" | \
pandoc -V geometry:margin=15mm -o "${FicPDF}"
Il fallait bien entendu indiquer le nom du fichier modèle MD.
Le 3 janv. 2025 à 23:41, Pierre Malard <[email protected]> a écrit :
Bonsoir,
Je me suis trouvé devant le même problème il y a un certain temps. Je voulais créer un PDF à envoyer dans un script à partir d’un modèle en remplaçant certains champs mais avec une certaine mise en page; du mailing quoi.
Après avoir essayé plusieurs méthodes (LibreOffice, …) je suis tombé sur « pandoc » qui m’a semblé la moins mauvaise simple solution. Le modèle est écrit en MD, ce qui permet une certaine mise en page. Je remplace les champs à la volée
avec un « sed » et je délègue à « pandoc » la création du PDF.
Voilà la commande :
sed -e "s/{CRITERE1}/${VarCRITERE1}/« -e "s/{CRITERE2}/${VarCRITERE2}/" -e … \
pandoc -V geometry:margin=15mm -o "${FicPDF}"
Si je me souviens bien de la liste des dépendances :
pdftk libc-bin pandoc texlive-latex-base texlive-latex-recommended texlive-plain-generic
En espérant que ça t’aide… Bonne année
Le 3 janv. 2025 à 23:22, ajh-valmer <[email protected] <mailto:[email protected]>> a écrit :
Hello,
Je ne trouve pas une méthode, une application,
pour convertir un fichier texte (.txt) en PDF.
Merci.
Très bonne année 2025 à tous.
ajh Valmer
--
Pierre Malard
« Si l'on veut croire en l'humanité,
il faut voir et comprendre l'inhumanité »
|\ _,,,---,,_
/,`.-'`' -. ;-;;,_
|,4- ) )-,_. ,\ ( `'-'
'---''(_/--' `-'\_) πr
perl -e '$_=q#: 3|\ 5_,3-3,2_: 3/,`.'"'"'`'"'"' 5-. ;-;;,_: |,A- ) )-,_. ,\ ( `'"'"'-'"'"': '"'"'-3'"'"'2(_/--'"'"' `-'"'"'\_): 24πr::#;y#:#\n#;s#(\D)(\d+)#$1x$2#ge;print'
- --> Ce message n’engage que son auteur <--
--
Pierre Malard
« On ne peut pas pousser à fond l'éducation politique et l'éducation
tout court de masses sans l'accompagner d'un développement
économique, culturel et social parallèle. »
Romain Gary - "Les racines du ciel"
|\ _,,,---,,_
/,`.-'`' -. ;-;;,_
|,4- ) )-,_. ,\ ( `'-'
'---''(_/--' `-'\_) πr
perl -e '$_=q#: 3|\ 5_,3-3,2_: 3/,`.'"'"'`'"'"' 5-. ;-;;,_: |,A- ) )-,_. ,\ ( `'"'"'-'"'"': '"'"'-3'"'"'2(_/--'"'"' `-'"'"'\_): 24πr::#;y#:#\n#;s#(\D)(\d+)#$1x$2#ge;print'
- --> Ce message n’engage que son auteur <--
--Apple-Mail=_D752F860-1A6B-493C-9961-F0085A044CA4
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=utf-8
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Oups, <div class=""><br class=""></div><div class="">J’
avais oublié gun paramètre dans la ligne de commande :</div><div class=""><div class="" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: HelveticaNeue;"><font face="Courier New" class="">sed <font color="#000000" class=""><span
class="">-e "s/{CRITERE1}/${VarCRITERE1}/" </span></font><span class="">-e "s/{CRITERE2}/${VarCRITERE2}/</span></font><span class="" style="font-family: "Courier New";">" </span><font face="Courier New" class=""> \</font></
<div class="" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: HelveticaNeue;"><font face="Courier New" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>-e […] "${FicModeleMD}" | \</font></div><div
class="" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: HelveticaNeue;"><font face="Courier New" class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>pandoc -V geometry:margin=15mm -o </font><span class=""
style="font-family: "Courier New";">"</span><font face="Courier New" class="">${FicPDF}"</font></div></div><div class=""><br class=""></div><div class="">Il fallait bien entendu indiquer le nom du fichier modèle MD.<br class=""><div><br class="
"><blockquote type="cite" class=""><div class="">Le 3 janv. 2025 à 23:41, Pierre Malard <<a href="mailto:
[email protected]" class="">
[email protected]</a>> a écrit :</div><br class="Apple-interchange-newline"><div class="
"><div class="content-isolator__container"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Bonsoir,<div class=""><br class=""
</div><div class="">Je me suis trouvé devant le même problème il y a un certain temps. Je voulais créer un PDF à envoyer dans un script à partir d’un modèle en remplaçant certains champs mais avec une certaine mise en page; du mailing
quoi.</div><div class="">Après avoir essayé plusieurs méthodes (LibreOffice, …) je suis tombé sur « pandoc » qui m’a semblé la moins mauvaise simple solution. Le modèle est écrit en MD, ce qui permet une certaine mise en page. Je
remplace les champs à la volée avec un « sed » et je délègue à « pandoc » la création du PDF.</div><div class=""><br class=""></div><div class="">Voilà la commande :</div><div class=""><div class=""><font face="Courier New"
class="">sed <font class=""><span style="caret-color: rgb(0, 0, 0);" class="">-e "s/{CRITERE1}/${VarCRITERE1}/« </span></font><span style="caret-color: rgb(0, 0, 0);" class="">-e "s/{CRITERE2}/${VarCRITERE2}/</span></font><span style="caret-
color: rgb(0, 0, 0); font-family: "Courier New";" class="">"</span><font face="Courier New" class=""> -e … \</font></div><div class=""><font face="Courier New" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>pandoc -
V geometry:margin=15mm -o </font><span style="caret-color: rgb(0, 0, 0); font-family: "Courier New";" class="">"</span><font face="Courier New" class="">${FicPDF}"</font></div></div><div class=""><br class=""></div><div class="">Si je me
souviens bien de la liste des dépendances :</div><div class="">pdftk libc-bin pandoc texlive-latex-base texlive-latex-recommended texlive-plain-generic</div><div class=""><br class=""></div><div class="">En espérant que ça t’aide… Bonne année<br
class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">Le 3 janv. 2025 à 23:22, ajh-valmer <<a href="mailto:
[email protected]" class="">
[email protected]</a>> a écrit :</div><br class="Apple-interchange-newline"><div
class=""><div class="">Hello,<br class=""><br class="">Je ne trouve pas une méthode, une application, <br class="">pour convertir un fichier texte (.txt) en PDF.<br class="">Merci.<br class=""><br class="">Très bonne année 2025 à tous.<br class=""><
br class="">ajh Valmer<br class=""><br class=""></div></div></blockquote></div><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -
webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-
stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-
transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0);
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-
space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap:
break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-
wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="margin: 0px; font-size: 10px; font-family: "Courier New";" class="">-- </div><div style="margin: 0px; font-size: 10px; font-family: "
Courier New";" class=""><div style="margin: 0px;" class="">Pierre Malard</div><div class=""><br class=""></div></div><div style="margin: 0px; font-family: Times;" class=""> « <i class="">Si l'on veut croire en l'humanité,</i></div><div
style="margin: 0px; font-family: Times;" class=""><i class=""> il faut voir et comprendre l'inhumanité</i> »</div><div style="margin: 0px; font-size: 10px; font-family: "Courier New";" class=""> |\
_,,,---,,_</div><div style="margin: 0px; font-size: 10px; font-family: "Courier New";" class=""> /,`.-'`' -. ;-;;,_</div><div style="margin: 0px; font-size: 10px; font-
family: "Courier New";" class=""> |,4- ) )-,_. ,\ ( `'-'</div><div style="margin: 0px; font-size: 10px; font-family: "Courier New";" class=""> '---''(_/--' `-'\_) πr</div><div
style="margin: 0px; font-family: Times; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-size: 10px; font-family: "Courier New";" class="">perl -e '$_=q#: 3|\ 5_,3-3,2_: 3/,`.'"'"'`'"'"' 5-. ;-;;,_: |,A- &
nbsp;) )-,_. ,\ ( `'"'"'-'"'"': '"'"'-3'"'"'2(_/--'"'"' `-'"'"'\_): 24πr::#;y#:#\n#;s#(\D)(\d+)#$1x$2#ge;print'</div><div style="margin: 0px; font-family: "Courier New";" class=""><span style="font-size: 10px;" class="">- --> Ce
message n’engage que son auteur <--</span></div></div></div></div></div></div></div></div>
</div>
<br class=""></div></div></div></div></blockquote></div><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-
wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space:
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-
spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"
class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration:
none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align:
start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-
spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="
margin: 0px; font-size: 10px; font-family: "Courier New";" class="">-- </div><div style="margin: 0px; font-size: 10px; font-family: "Courier New";" class=""><div style="margin: 0px;" class="">Pierre Malard</div><div class=""><br
class=""></div></div><div style="margin: 0px; font-family: Times;" class=""> «<span class="Apple-converted-space"> </span><i class="">On ne peut pas pousser à fond l'éducation politique et l'éducation</i></div><div style="margin: 0px; font-
family: Times;" class=""><i class=""> tout court de masses sans l'accompagner d'un développement</i></div><div style="margin: 0px; font-family: Times;" class=""><i class=""> économique, culturel et social parallèle.<
span class="Apple-converted-space"> </span></i>»</div><div style="margin: 0px; font-family: Times;" class=""> &
nbsp; Romain Gary - "Les racines du ciel"</div><div style="margin: 0px; font-size: 10px; font-family: "Courier New";" class=""> |\ _,,,---,,_</div><div style="margin:
0px; font-size: 10px; font-family: "Courier New";" class=""> /,`.-'`' -. ;-;;,_</div><div style="margin: 0px; font-size: 10px; font-family: "Courier New";" class=""> |,4- &
nbsp;) )-,_. ,\ ( `'-'</div><div style="margin: 0px; font-size: 10px; font-family: "Courier New";" class=""> '---''(_/--' `-'\_) πr</div><div style="margin: 0px; font-family: Times; min-height: 14px;" class="">
<br class=""></div><div style="margin: 0px; font-size: 10px; font-family: "Courier New";" class="">perl -e '$_=q#: 3|\ 5_,3-3,2_: 3/,`.'"'"'`'"'"' 5-. ;-;;,_: |,A- ) )-,_. ,\ ( `'"'"'-'"'"': '"'"'-3'"'"'2(_/--'"'"'
`-'"'"'\_): 24πr::#;y#:#\n#;s#(\D)(\d+)#$1x$2#ge;print'</div><div style="margin: 0px; font-family: "Courier New";" class=""><span style="font-size: 10px;" class="">- --> Ce message n’engage que son auteur <--</span></div></div></div></
</div></div></div></div>
</div>
<br class=""></div></body></html> --Apple-Mail=_D752F860-1A6B-493C-9961-F0085A044CA4--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.2
Comment: GPGTools -
http://gpgtools.org
iQIzBAEBCgAdFiEE0KHTJ+AWKhmI+acm/pSWHuad/BgFAmd4aS0ACgkQ/pSWHuad /BjMUA/+Pfq7K4z004ESDwKW9DxFV4lgj3tb0lJnd6Qbe5hLekEhQ3lbYum6Q74O e9MCvvby/lx6YFFan28NrKOkjqK83dfxuh+GtPsjL66ZtHp6xx20WsI/zNHSbsms MTzm14Sa8m9c1R3a7rDrLSpxHrz0QOkb4oRKSdlPTu+jzzHtD4m8WH4kBUHoKuEg HoeafswT7EdokKLl4DmBJlk/UnSZ2Gc3UUAwx5T8NarYlOhjwGCdUJr5s6ZecMwp nCxPCFEcjofdz+VdmiVlb0JRfF3te1+XUKv16eK11tlmWmZKWZC7BtRnEug6ruXt SwA+ajG1MGU/r+0kkJGsIYI0IgIJZjdJg5oC7cte6ZhPjyxT4a+UXtUCogqmg7yN A6P0YMjWG2Fo1BeHamktP+Gpadxrrp8c4sDlFKis8OQX9whcKc+pPJ8KJ56vU+8L srxb7IaJRm5+zQ43gmVst21lTpMh7ykSeQKOq+R65kPcq4igxoZ0QesXfd/+bl1N 5aezNw5xKy34nDvbOZ4a/0RKji/6nrH39+bDf4Ham3cWohD6592UPiG+NklhkHt6 cc3nAfCCvSJmBNWpKGdJrpWbglx96cfjAda+KeXmJH4EuDJRlVXeOG5DTPtb7pok fEo7TZudOJ0kyXSG4XDFfeZRMEtiXphOK7QvTKeyWID44m7PwnU=
=A0tk
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)