convert
$ convert scan*.jpg scan.pdf
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.
Comment out the restrictions in /etc/ImageMagick-6/policy.xml
:
<!-- disable ghostscript format types -->
<!--
<policy domain="coder" rights="none" pattern="PS" />
<policy domain="coder" rights="none" pattern="EPI" />
<policy domain="coder" rights="none" pattern="PDF" />
<policy domain="coder" rights="none" pattern="XPS" />
-->
<policy domain="coder" rights="read|write" pattern="PDF,PS" />
</policymap>
https://cromwell-intl.com/open-source/pdf-not-authorized.html