0

Is there a markup language that can be used in conjunction with a well supported .net open source project to generate PDF or HTML documents with very fine control on the output in terms of style and anchoring for both ?

Documents will part be static and part auto generated from the xml comments of some class libraries.

To Clarify the question, I Know html is a markup language, The reason I don't want to use it to directly store the content is because all of the HTML to PDF tools and libraries I have looked at contain patchy support for creating tables of contents, indexes and turning hyperlinks in to PDF document anchors.

user1450877
  • 421
  • 5
  • 16
  • I'm not too sure what you mean. Do you mean something like XSL:FO? – Mike B Jul 10 '13 at 15:09
  • The questions is not clear to me. HTML is a markup language. You are looking for a markup language for the source document that be be rendered to both PDF and HTML? – paparazzo Jul 10 '13 at 15:18
  • Then look at XSL:FO as commented by Mike B. Base language of XHTML. Or a base of HTML as there are HTML to PDF converters. Would not use PDF as the base - from PDF is a more complex. – paparazzo Jul 10 '13 at 15:32
  • Multimarkdown will generate HTML and PDF. See: http://stackoverflow.com/a/18091195/123033 As for .net integration, that's not so clear, see http://forums.markdownpad.com/discussion/41/multimarkdown-support/p1 – Dave Everitt Aug 19 '13 at 21:39

3 Answers3

0

I would opt for HTML documents. Markdown comes to mind. But as far as 'very fine' control goes arbitrarily, you can always just use HTML.. it is THE HyperText Markup Language after all.

Alexander Mistakidis
  • 3,130
  • 2
  • 20
  • 23
0

There were many questions like this before on stackoverflow. I think the consensus is that you should have one markup language, rather than two.

HTML is - by definition (hypertext MARKUP LANGUAGE) - the markup language of choice and all you need to do is convert that to PDF. The other way around, from PDF to HTML is quite a bit tougher.

In order to convert HTML to PDF there's a truckload of tools, depending on what exact needs you have for the resulting PDF and what kind of CSS you need to support.

I'd always go for a rendering engine that's used in browsers (instead of something like iText or Prince), because you want to make sure your docs look like they do in a browser. You'd end up with Winnovative or something based on WebKit like the API by htm2pdf.

user1914292
  • 1,586
  • 13
  • 38
  • None of the HTML Solutions I have looked at contain much support at all for generating contents tables or indexes and that sort of thing. – user1450877 Jul 10 '13 at 15:31
  • The problem with indexes in HTML is that you want pagination. And HTML content is not paged in a continuous way like documents. So you'd have to create your own HTML index, by referring to the other HTML pages - sort of like a sitemap. Come to think of it - there's actually an open source tool, called wkhtmltopdf, which DOES allow you to create outlines and cover pages and stuff like that. That's probably worth checking out. – user1914292 Jul 10 '13 at 17:36
0

XSL-FO is the recommended solution. It provides a great level of control over the document layout and there are several tools for XSL-FO to PDF comversion.

Mihai Iancu
  • 1,818
  • 2
  • 11
  • 10