Tool to generate CHM and PDF documentation from Markdown on Windows - pdf

Is there a tool that generates both PDF and CHM documentation from Markdown (or similar, such as RST) on Windows.
We are currently using Sphinx, but have been unable to get the PDF generation working on Windows (this guy has the same issue). It's a pain to have to generate the CHM on Windows and the PDF version on Linux (and I do need to generate both versions).
Is there an alternative tool (free or inexpensive commercial) that could do this task?
The source format must be in a plain-text-like format for version control, of which Markdown and RST are examples.

The Free Pascal distribution holds a CHM compiler called chmcmd. Some people with documentation tools report success with it (like the Preshrunk-cotton python package)
Some Linux distros also pack the chm compiler independently from the main FPC distribution. (since it only is a 700k binary without dependencies).
On Windows you can use the same (the windows version of chmcmd), or Microsoft Help Workshop, the default CHM generator from MS.
That's the CHM compiler part, now the input:
A CHM project before compilation is basically just html with a couple of XML indexes (TOC and master keyword based index) and a project file that is an INI file.
Usually the HTML generator backend of a documentation tool is tweaked to generate it as a special case. From what I read in your "this guy" link, sphinx can do that.

I was able to fulfil this need using Sphinx after all. I used MiKTeX to generate the PDF on Windows.
Install MiKTeX (< 200mb)
wget -nv -N http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable-2.9.4757.exe
7z.exe x -y miktex-portable-2.9.4757.exe -o"miktex"
Add the bin directory to your path
SET Path=%Path%;%CD%\miktex\miktex\bin
Run Sphinx's "make.bat" to generate the .tex file.
SET SPHINXOPTS=-W -E
make.bat latex
Invoke MiKTeX's pdflatex:
cd build/latex
pdflatex.exe YOUR_PROJECT_NAME.tex
The resultant PDF will be in your build/latex directory

Related

Understanding PDFBox jar files

I am attempting to install PDFBox on my system in order to create PDF files, but am unsure which jar files I need. If I go to https://pdfbox.apache.org/download.cgi
I see command line tools as follows:
pdfbox-app (9.1MB)
preflight-app (9.2MB)
debugger-app (9.0MB)
I also see "Libraries of each subproject" as follows:
pdfbox (2.6MB)
fontbox (1.6MB)
preflight (248KB)
xmpbox (132KB)
pdfbox-tools (77KB)
pdfbox-debugger (245KB)
What is meant by "each subproject"? Is it talking about the command line tools or something different?
I am planning to use java from the command line rather than in an IDE. Does this mean that I just need the Command line tools or do I need the "Libraries of each Subproject" as well? What does the "-app" indicated in the command line tools vs the related libraries?
Is there a page on apache.org that mentions the differences between all of these?
To create PDF files should I be using the preflight and debugger files as well or are those optional?
Summarizing the comments: you want to create a PDF from scratch and access your development over ssh so you can't use an IDE and have to use javac. For that you could use pdfbox-app jar file, but this would be huge. Instead, use the pdfbox, fontbox and commons-log jar files. See also here for additional dependencies if you want to do more advanced stuff (read / render (= convert to image) / decrypt / sign).

Sphinx PDF output using latexpdf

I am trying to build Sphinx doc output as PDF rather than HTML. I can only use the tools which come with Sphinx, i.e. I cannot download additionl tools like rst2pdf. I have tried using 'make latexpdf', per the Sphinx documentation, which states it will produce pdf in addition to the .tex files. However I am only getting .tex. What am I missing? The Sphinx documentation states that PDF files will be produced.
Sphinx uses Latex to export the documentation as a PDF file.
Thus one needs the basic Latex dependencies used to write a pdf on the system.
For example, on a system running Ubuntu 16.04, they can be downloaded and installed by :
apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
If running Sphinx 1.6 or above on GNU/Linux or OSX, you may also need the latexmk package.
Reference: sphinx.builders.latex.LaTeXBuilder documentation.
After installing the above packages, running make latexpdf in the sphinx project directory generates the documentation output as the PDF file ./_build/latex/<sphinx-project-name>.pdf>
Note: In the current scenario where you do not see a PDF file on your system after running make latexpdf, check the output of the command for any errors regarding missing latex tools/files. Use the system package manager to identify the missing packages and install them.

Generate PDF/HTML from Doxygen's Docbook Output

Doxygen 1.8.4 included a patch which adds Docbook support. This can be enabled via GENERATE_DOCBOOK. I've tried it with an existing code base and I am able to generate a docbook directory containing xml files.
How can I generate a PDF file from that output?
How can I view the docbook output in a web browser? This question may not be relevant if the content will be identical to the standard doxygen output, but I'm curious.
The Dockbook specialization contains many XSL conversions including HTML and XSL FO to obtain PDF. I would suggest searching Docbook and download these.
A simple way:
Install Eclipse
Go to Eclipse Marketplace, search for docbook and install DEP4E from there
Create DocBook project
Replace the existing docbook with yours
Run build.xml - Ant will ask you in which formats to publish the book. Choose PDF.

Tool to convert pdf files to SWF

Is there any open source tool to convert PDF to SWF other than pdf2swf tools?
pdf2swf uses "xpdf" to process PDF files.
You can try ImageMagic, it uses a different library (gscript) to process PDF files. You will have to convert to some intermediate format (like JPG/ SVG) and use a different tool to create SWF.
Have you tried SWFTOOLS? On Debian/Unbuntu:
sudo apt-get install swftools
pdf2swf filename.pdf
http://wiki.swftools.org/index.php/Examples#pdf2swf They have a Windows version, and the source so you can compile it on other Linux flavors

Visual Basic Edit Tar Archive

Is it possible for vb to extract files from tar(and put them back)? I found this but it says that
Dim tar As New ChilkatTar <<<< ChilkatTar does not exist
I am trying to edit one xml file(which is not compressed) but if i do that with notepad, the tar becomes corrupt
ChilkatTar is a commercial component that you'd need to purchase, you can find it here:
7-zip supports unpacking and packing TAR files and is free so you could probably execute the command line version of it from your app to do the packing/unpacking.
It is also open-source, so you might even be able to copy the source into a library to use from your own application if you prefer, assuming that its license is compatible with your needs.