Pandoc --toc Command is not working right - pandoc

Following the document, I am using --toc and -s/--standalone command to generate table of content(toc). After converting from .html to .docx, opening file in Word, the result would be like this, the table of content is gone.
Then open same file in MacOS Pages, toc is displayed but the format looks damn weird.
Any thought on this? thanks in advance.

Related

How can I the image start from a new line when using dita-ot-3.0 pdf plug outputting PDF?

hope someone to help me, thanks!
When I use dita-ot-3.0 to output pdf, I find in many places, the images are displayed in the same line with text.
I try two plugins:
- default pdf2 plugin
- a customization pdf plugin using PDF Plugin Generator at https://github.com/jelovirt/dita-generator (I didnot find any place to set image attribute)
So here is my question, I write xml like this:
source xml file
When I output pdf, I get this:
image is shown in the same line with text
there are many other images showing like that. How can I make the image show starting from a new line? Am I misusing the element? Is the difference between inline element or block?
You should be able to do this by setting the attribute placement="break" to the <image> element. This is explained in the spec.

Sphinx build rst to html single page

I need to build HTML from RST with sphinx-build. Now I use command:
os.system("sphinx-build -b singlehtml -T -D html_add_permalinks=None -D extensions='sphinx.ext.autodoc' -D master_doc='index' -C /my/doc /tmp/sphinx")
But as result it gives complicated HTML with css and JS. But I need only one HTML page with all combined RST files. Maybe even without table of content. Or if it is possible with table of content that works without JS.
I searched for such option in official documentation a lot but did not find what I need.
Please help if somebody knows how to do it.
To convert to pure HTML you better use https://pandoc.org/
Alternatively you could post-process the Sphinx generated HTML to remove all CSS and Javascript.

Prevent asciidoc from converting a file path into a link

I'm manually converting a MS Word document to asciidoc format.
By doing so I ran into an issue that I can't work around yet.
There is an example where I want to show the reader of how the syntax of a file link should look like.
So I used this as an example:
file:///<Path>/<to>/<Keytab>
Asciidoc now renders this pseudo link into an actual link and warns me about this while converting my asciidoc document into HTML and PDF.
Usually, I would simply use the [source] element to prevent the link rendering. But the file link is part of a table.
[options="header,footer",cols="15%,85%"]
|=======================
|parameter|usage
|keyTabLocation |file:///<Path>/<to>/<Keytab>
|=======================
Is there a way to prevent the rendering/convertion of the file link?
Okay, I found the solution. I had to escape the whole macro using a \ at the beginning.
So this did the trick:
[options="header,footer",cols="15%,85%"]
|=======================
|parameter|usage
|keyTabLocation |\file:///<Path>/<to>/<Keytab>
|=======================

convert pdf to html using abcpdf

i am looking for a method to convert a pdf document into corresponding html document using abcpdf. kindly let me know if it is feasible. FYI, My pdf document has rich text along with images.
You can. Try this. Hopefully it'll work.
var doc = new WebSupergoo.ABCpdf10.Doc();
doc.Read('your Pdf byte array');
doc.Save('your HTML file path with .html extension');
doc.Clear();
doc.Dispose();
For documentation please have a look at the note section
http://www.websupergoo.com/helppdfnet/source/5-abcpdf/doc/1-methods/save.htm
To export as XPS, PostScript, DOCX or HTML you need to specify a file path with an appropriate extension - ".xps", ".ps", ".docx", ".htm", ".html" or ".swf". If the file extension is unrecognized then the default PDF format will be used.
You can definitely convert HTML to PDF, but I am not sure the inverse is possible to do with abcpdf.
Perhaps you can give a try to iText (iTextsharp)

Save desired pdf page from pdf file using ruby

I have a pdf file. I want to save a given page (page #5, for intsance) as other pdf file. How do I accomplish this?
So far I've used pdf-reader gem – but it's suitable for reading pdfs (though I can get to the page I want), and I gem prawn – this one's only for writing pdf (I can only create empty pdf file).
It was here: Statically compile pdftk for Heroku. Need to split PDF into single page files
Try something like:
require 'prawn'
Prawn::Document.generate('new.pdf') do |pdf|
pdf.start_new_page(:template => "input.pdf", :template_page => 5)
end
Don't know on what system you are, but on my ubuntu12.04 box, the pdftk program worked:
pdftk A=your_beautiful.pdf cat A3 output page3.pdf
So you could use backticks for this, and read up on http://www.linuxjournal.com/content/tech-tip-extract-pages-pdf

Resources