Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to export accessible PDF #602

Open
giamma opened this issue Mar 29, 2023 · 5 comments
Open

How to export accessible PDF #602

giamma opened this issue Mar 29, 2023 · 5 comments

Comments

@giamma
Copy link

giamma commented Mar 29, 2023

Hello,

how do you ask unoconv to switch on accessible PDF export in LibreOffice?
e.g.
immagine

@giamma
Copy link
Author

giamma commented Apr 5, 2023

Sorry to push, any feedback for this request?

@regebro
Copy link
Member

regebro commented Aug 11, 2023

I don't know if there is any LibreOffice documentation for what the export options are actually called, but if there is, that's where you need to look. If there isn't, then your guess is as good as mine.

@pft
Copy link

pft commented Mar 25, 2024

There weren't any command-line options although nothing indicated that. It seemed as if the last setting within the used profile was used.

As of LibreOffice 7.4, you can do this with headless office:

soffice --convert-to 'pdf:writer_pdf_Export:{"SelectPdfVersion":{"type":"long","value":2}, "UseTaggedPDF": {"type":"boolean","value":true}, "PDFUACompliance": {"type":"boolean", "value": true}}' test.odt

(See https://ask.libreoffice.org/t/solved-convert-to-pdf-with-specific-settings-from-command/40192/5)

But if I try and use that syntax with unoconv I get a parsing error from unoconv:

unoconv -f pdf -e '{"SelectPdfVersion":{"type":"long","value":2},"UseTaggedPDF":{"type":"boolean","value":true},"PDFUACompliance":{"type":"boolean","value":true}}' -o uno2.pdf test.odt 
/usr/bin/unoconv:19: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.version import LooseVersion
Warning: Option {"SelectPdfVersion":{"type":"long","value":2},"UseTaggedPDF":{"type":"boolean","value":true},"PDFUACompliance":{"type":"boolean","value":true}} cannot be parsed, ignoring.

Because it goes through UNO, I wouldn't know what's the correct syntax there or whether it is at all supported.

@giamma
Copy link
Author

giamma commented Mar 26, 2024

Hi answering my own question this works for me

unoconv -e EnableTextAccessForAccessibilityTools=true -e UseTaggedPDF=true [other parameters]

@pft
Copy link

pft commented Mar 26, 2024

Hi there, I now added

unoconv -f pdf -e EnableTextAccessForAccessibilityTools=true -e SelectPdfVersion=2 -e UseTaggedPDF=true -e PDFUACompliance=true

This seems indeed to work, at least for 7.6 on Windows. First tried it on Linux, but there I have a hard time for unoconv to look at different installations than the one that came with Ubuntu is 7.3.

Most machine-checkers seem pretty satisfied with the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants