Description: I'm forwarding this bug from Debian as the submitter (https://bugs.debian.org/969299). Consider the minimal LaTeX document: \documentclass[letterpaper]{article} \begin{document}f\end{document} If one uses a direct-to-PDF engine such as PDFLaTeX, XeLaTeX, or LuaLaTeX, and then tries to sign it with LibreOffice's 'Sign Existing PDF' feature, the document may appear to have been legitimately signed within the UI, but in fact the original document has been corrupted. Steps to Reproduce: 1. Make foo.tex with the hitherto-described example contents 2. Run 'lualatex foo.tex' to make foo.pdf 3. Open a LibreOffice application 4. Navigate to File->Digital Signatures->Sign Existing PDF 5. Click 'Sign Document' 6. Click 'Sign Document' in the dialog and choose the appropriate certificate 7. Close the dialog, observe LibreOffice's statement the document has been signed, and close LibreOffice 8. Open PDF in a viewer, or reopen it with LibreOffice Actual Results: Okular says the PDF is corrupted. LibreOffice wrongly says 'This PDF file is encrypted and can't be opened,' but nonsensically still affirms 'This document is digitally signed and the signature is valid.' Expected Results: It should have shown a signed PDF with its original contents. Reproducible: Always User Profile Reset: No Additional Info: Version: 7.0.4.2 Build ID: 00(Build:2) CPU threads: 2; OS: Linux 5.10; UI render: default; VCL: kf5 Locale: en-US (en_US.UTF-8); UI: en-US Debian package version: 1:7.0.4-3 Calc: threaded Safe mode does not permit me to choose my certificate.
Created attachment 169124 [details] fresh test PDF from LuaLaTeX
As a workaround, I compile my LaTeX to DVI and then convert to PDF; then it works.