Comment sortir le document créé au format PDF en utilisant rst2pdf
OS:Mac OS X 10.9.5 Python:Ver.2.7.7
$ sudo easy_install rst2pdf
・ ・ ・
Finished processing dependencies for rst2pdf
Si vous obtenez ce résultat, vous avez terminé.
conf.py Ajoutez ce qui suit à conf.py
extensions = ['rst2pdf.pdfbuilder']
# -- Options for PDF output --------------------------------------------------
pdf_documents = [
('index', u'MyProject', u'My Project', u'Author Name'),
]
pdf_stylesheets = ['sphinx','kerning','a4','ja']
pdf_language = "ja"
Makefile Ajoutez ce qui suit à Makefile
pdf:
$(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $(BUILDDIR)/pdf
@echo
@echo "Build finished. The PDF files are in _build/pdf."
ja.json Ajouter ja.json
{
"embeddedFonts" : [
"VL-Gothic-Regular.ttf",
"VL-PGothic-Regular.ttf",
"ipam.otf",
"ipag.otf",
"ipagp.otf",
"ipamp.otf"
],
"fontsAlias" : {
"stdFont": "VL-PGothic-Regular",
"stdBold": "VL-PGothic-Regular",
"stdItalic": "VL-PGothic-Regular",
"stdBoldItalic": "VL-PGothic-Regular",
"stdMono": "VL-Gothic-Regular",
"stdMonoBold": "VL-Gothic-Regular",
"stdMonoItalic": "VL-Gothic-Regular",
"stdMonoBoldItalic": "VL-Gothic-Regular",
"stdSans": "VL-Gothic-Regular",
"stdSansBold": "VL-Gothic-Regular",
"stdSansItalic": "VL-Gothic-Regular",
"stdSansBoldItalic": "VL-Gothic-Regular"
},
"styles" : [
["base" , {
"wordWrap": "CJK"
}],
["literal" , {
"wordWrap": "None"
}]
]
}
$ make pdf
Généré dans le dossier _build / pdf.
Si vous obtenez l'erreur suivante lors de l'installation de rst2pdf
error: Setup script exited with error: command 'cc' failed with exit status 1
Installez xcode-select
$ xcode-select --install