سؤال

أنا أكتب تقريرا رئيسيا، ولديك ملفان PDF وأرغب في تضمين الملحقين.يتم كتابة التقرير باستخدام إعادة الهيكل، وسيتم استخدام RST2PDF لتحويله.

هل يحتوي Docutils أو RST2PDF على أي وظيفة للملفات الخارجية كملحقات؟

هل كانت مفيدة؟

المحلول 3

In the end, I couldn't fix this problem directly. I converted the ReStructuredText file to Latex, and included the appendices there.

نصائح أخرى

Docutils has the raw directive for passing data through to the final output untouched. In the documentation they demonstrate this for the LaTeX and HTML outputs. rst2pdf seems to support this directive: in the manual they use the raw directive to include some text/commands in the final PDF (see the section headed Raw Directive) but they do not demonstrate using this directive for including external PDF files.

If rst2pdf does support this feature, you should just be able to use:

.. raw:: pdf
   :file: your_pdf_file.pdf
   :encoding: the encoding of the PDF file, if different from the
              reStructuredText document's encoding.

I have just had a go at doing this (if in doubt, give it a go) and I get a number of UnicodeDecodeErrors, so the feature seems to be supported but I can't get it to work.

You could embed PDFs as images, but that makes no sense for appendixes.

If you only have those files as PDF, you can add them using a PDF manipulation tool, but those usually break page numbering or links or some other piece of the PDFs.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top