Markdown to pdf: page marking - pdf-generation

I want to make pdf by markdown: write makrdown and convert it in pdf.
Can I page marking by means of a markdown?
I understand as "a page marking" transition to new page, location of a line to page center across, text location in page center, etc.
Thanks.

I suspect that the best way to get about doing this is to do a Markdown-HTML-PDF convertion. Your markdown implementation should be able to generate HTML and then use something like wicked_pdf (ruby) or the underlying wkhtmltopdf to go from HTML to PDF. The wicked_pdf documentation outlines how to do page numbering with the help of some javascript. For page breaking you should be able to use CSS to keep things together and force page breaks. Check out page-break-inside and page-break-after for this. There is a discussion about it in the wkhtmltopdf manual.

Related

Asciidoc: how to get page headers & footers?

Is there a correct way to get Asciidoc to include headers and footers?
I am trying to work out whether Asciidoc is a serious contender for printed material. I know that it is supposed to be docbook compatible, but I can’t find out how to create chapters, headers and footers.
I am trying to create instructional material. Currently I am using Atom with the asciidoc plugin to create the text, and Marked 2 on the Mac to get a better look and to export it to PDF.
Running page headers and footers are not part of the AsciiDoc language but the tool you use for PDF conversion. From my view you have (at least) 2 options:
Follow the instructions in Exporting Print/PDF of your Marked 2 user manual to create page headers and footers (this might turn out difficult using the AsciiDoc processor instead of MultiMarkdown).
"You can specify headers and footers on a per-document basis using MultiMarkdown metadata at the very top of the document"
Since you probably have installed Asciidoctor anyway to support asciidoc in Marked 2 you could use an Asciidoctor PDF theme to generate PDF with headers/footers using Asciidoctor PDF. You would have to find an appropriate theme or create one yourself, though.
The most frequently used way to generate PDF output, however, seems to be generating DocBook output first and convert that to PDF using dblatex with DocBook XSL stylesheets (see AsciiDoc homepage). Maybe someone else can say more about that.

Convert HTML to PDF using TCPDF

I need to convert on the fly an HTML into PDF. I've been using the old HTMLDoc library for a while, but now I need to print SVG graphics and HTMLDoc doesn't support SVG nor base64-enconded images.
So far it seems to me that TCPDF (or a tool based on it) is a good way. The only problem is that I don't want to "build" the PDF document in PHP, as the HTML is dynamic.
Is there any way to write a script that simply takes a portion of HTML page and returns a PDF? That would imply some sort of way to specify start/stop markers in the HTML page (just like in HTMLDoc).
Thanks for any advice,
Thomas
TCPDF has got very limited css support and some bugs with " quotes, so from any html to pdf TCPDF is not an option for you unfortunetly
TCPDF not supports all css functionality, mpdf 6.0 is best ever pdf library for convert html to pdf, It also supports almost required css as well. I prefers htmlcanvas jquery for convert html to image.

How to maintain HTML internal links when converting with Pandoc

I am trying to convert from html to pdf with Pandoc. The output is pretty nice, still with the command pandoc index.html -o output.pdfI lose all my internal links (from table of contents to chapters, from text to footnotes, etc).
In my HTML this is the outdegree link
<p class="calibre18"><span class="calibre8">CHAPTER ONE</span><br class="calibre19"></br>The Ever Expanding Domain of Computation</p>
which then lands here
Chapter 1 makes the case that because of...
and here
<p class="calibre18"><span class="calibre8">CHAPTER ONE</span><br class="calibre19"></br>The Ever Expanding Domain of Computation</p>...
Is there any way to keep all the links also in the output?
The Pandoc User's Guide section on Internal Links says
Internal links are currently supported for HTML formats (including HTML slide shows and EPUB), LaTeX, and ConTeXt.
This suggests that internal links aren't currently supported for PDF output, even though the PDF output is generated via LaTeX.
Internal links should work straightforwardly in PDF. However, for printing purposes, the default is not to color them. Have you tried clicking on the text that should be a link?

I am using HTML snippet in to Highlight HTML and Javascript code in blog Joomla. but it's executed after saving it

while creating a article I want to show some HTML code as part of content, but after saving that article that particular snippet of HTML code get executed.
I am using joomla 1.5 | code citation extension for insert code in article. Is there any solution?
You should turn off HTML stripping, or include it as a Custom HTML Module, and writing the position in the article with load position. to load the custom HTML you've put in the Module. i.e.
{loadposition YourModulePosition}
Will load anything you place within a Custom HTML Module.
The correct way should be to paste the code into the wysiwyg (design view, not raw code view) - as long as you have a decent editor the angle brackets should be converted to html entities and it should just work.
The built-in Geshi plugin - though a little dated - is usually all that is needed to make add colored highlighting. The plugin is a little dated but after inserting your code all you need to do to make it work is add:
<pre class="html"> ... </pre>
around your html. Chenge HTML to js, css, etc depending upon the code to be shown.

create a simple pdf report from html

I'm looking for a way to generate pdf files from html
In order to make simple tabular reports I would need the following features
table rendering
variable page size
repeating headers / footers on every page
calculated page number / total page
css support would be nice
I know there have been many similar questions in stackoverflow, but I don't know if there's a product that supports the aforementioned features...
Ideally, the source would be a plain and simple well built html with css, (I'm building the html files, so I can adapt to the products needs, that is, it won't have to render every piece of html crap you can throw at a browser) and with some custom tags to configure headings, footer, page size, etc...
then I would run a command line to convert it from html to pdf.
I think http://www.allcolor.org/YaHPConverter/ does something like that
Take a look at TCPDF
Check out the examples.

Resources