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

PDF/A #344

Open
artel1992 opened this issue Jan 27, 2022 · 2 comments
Open

PDF/A #344

artel1992 opened this issue Jan 27, 2022 · 2 comments

Comments

@artel1992
Copy link

artel1992 commented Jan 27, 2022

Hello, i try create pdf using your cool library. But I get some problem with standart. I need add this string to preamble

\usepackage[a-2b,mathxmp]{pdfx}[2018/12/22]

but in generated tex file I get this:

\usepackage[a{-}2b,mathxmp]{pdfx}[2018/12/22]

What do I wrong?
and I don't understand how to add filecontents like this:

\begin{filecontents*}[overwrite]{\jobname.xmpdata}
	\Title{Document’s title}
	\Author{Author’s name}
	\Language{en-GB}
	\Subject{The abstract or short description.}
	\Keywords{keyword1\sep keyword2\sep keyword3}
\end{filecontents*}

my code

 def generate_tex_document(self) -> Document:
        doc = Document(default_filepath=str(self.file_directory / self.file_name),
                       documentclass=Command('documentclass', options='a4paper', arguments='article'))
        doc.preamble.append(Command('usepackage', options='russian', arguments='babel'))
        doc.preamble.append(Command('usepackage', arguments='pdfx', options=['a-2b', 'mathxmp'])) 
        # or doc.preamble.append(NoEscape(r'\usepackage[a-2b,mathxmp]{pdfx}[2018/12/22]'))
        doc.preamble.append(Command('usepackage', arguments='digsig, blindtext, hhline, tabularx, array'))

        doc.preamble.append(NoEscape(r'\renewcommand{\rmdefault}{cmss}%'))
        if self.subject.type_id == 3 or self.subject.type_id == 5:
            doc.preamble.append(NoEscape(
                r'\usepackage[a4paper,landscape, total={25cm, 21cm},left=2cm,top=0.5cm,right=0.5cm,bottom=0.5cm]{geometry}%'))
        else:
            doc.preamble.append(NoEscape(
                r'\usepackage[a4paper, total={20cm, 28cm}, left=2cm,top=0.5cm,right=0.5cm,bottom=0.5cm]{geometry}%'))
        doc.preamble.append(Command('hypersetup', arguments='pdfstartview='))
        return doc
@artel1992
Copy link
Author

I'm sorry this work

 doc.preamble.append(NoEscape(r'\usepackage[a-2b,mathxmp]{pdfx}[2018/12/22]'))

@artel1992
Copy link
Author

How I can add filecontents ?

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

1 participant