Html to pdf using pragma script
Hi, I want to convert the html page to pdf. the html contains svg and mathml content. Thanks Anand
Am 20.12.2010 um 09:48 schrieb Anand Raj:
Hi,
I want to convert the html page to pdf.
the html contains svg and mathml content.
http://pragma-ade.com/general/manuals/xml-mkiv.pdf http://dl.contextgarden.net/myway/tas/xhtml.pdf Wolfgang
Hi, Thank you so much for your prompt reply. I am new to this. my need is to convert the html page to pdf and this html contains svg and mathml content. I have linux environment 1. What are things to be installed to fulfill my need 2. how to convert html --> xml --> pdf using context (may be the commands) Thanks Anand On Mon, Dec 20, 2010 at 5:18 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
Am 20.12.2010 um 09:48 schrieb Anand Raj:
Hi,
I want to convert the html page to pdf.
the html contains svg and mathml content.
http://pragma-ade.com/general/manuals/xml-mkiv.pdf http://dl.contextgarden.net/myway/tas/xhtml.pdf
Wolfgang
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net
___________________________________________________________________________________
Am 2010-12-21 um 03:12 schrieb Anand Raj:
my need is to convert the html page to pdf and this html contains svg and mathml content. I have linux environment
1. What are things to be installed to fulfill my need 2. how to convert html --> xml --> pdf using context (may be the commands)
There's nothing ready-made that you can use out-of-the-nonexistant-box. ConTeXt is (part of) a programmable system that you can and must adapt to your needs. It's not that hard, but you can't expect us to provide you with a complete solution for your fuzzy needs. If you're ready to throw in some money, then there are enough hireable consultants here to do your work for you. - Install ConTeXt minimals. - Learn how to use ConTeXt generally. - Learn how to use ConTeXt with XML input. - Write your conversion settings of HTML to ConTeXt, since there is and can be no general solution. (Only proper XHTML can work at all!) - I guess you must write the SVG code to a buffer first to be able to use it as graphics input. - I don't know about MathML, probably also there are some setups to do. - Don't forget to write about your experiences in our wiki pages, in articles for TeX magazines, presetations at TeX conferences and perhaps in a MyWay tutorial. Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
On Tue, 21 Dec 2010 09:13:00 +0100
Henning Hraban Ramm
Am 2010-12-21 um 03:12 schrieb Anand Raj:
my need is to convert the html page to pdf and this html contains svg and mathml content. I have linux environment
1. What are things to be installed to fulfill my need 2. how to convert html --> xml --> pdf using context (may be the commands)
There's nothing ready-made that you can use out-of-the-nonexistant-box. ConTeXt is (part of) a programmable system that you can and must adapt to your needs. It's not that hard, but you can't expect us to provide you with a complete solution for your fuzzy needs.
Somehow, the OP reminds me of something I've read on the interwebs a long time ago: http://thedailywtf.com/Articles/plz-email-me-teh-codez.aspx Thomas
On 21-12-2010 8:04, Anand Raj wrote:
Hi,
how to map svg tags from xml and tex file.?
Dump the svg blob in a file (say image-1.svg) and then use \extenalfigure[image-1.svg] to place it. Conversion to pdf will happen automatically then. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Tue, Dec 21, 2010 at 10:01 AM, Hans Hagen
On 21-12-2010 8:04, Anand Raj wrote:
Hi,
how to map svg tags from xml and tex file.?
Dump the svg blob in a file (say image-1.svg) and then use \extenalfigure[image-1.svg] to place it. Conversion to pdf will happen automatically then if you have inkscape installed
-- luigi
Hi,
I have input xml file say *input.xml*
<?xml version="1.0" encoding="UTF-8"?>
<document>
<div class='question'>
<div>
Solve by factoring:
<br/><br/>
*<am>
<math title="3/12"><mstyle displaystyle="true" fontfamily="serif"><mfrac> 3</mn><mn>12</mn></mfrac></mstyle></math>
</am>*
<br/><br/>
Give <i>either</i> of the two solutions.
</div>
</div>
</document> Then I have the tex file to generate the pdf say *generate.tex*
\usemodule[mathml]
\setupbodyfont[palatino]
\startxmlsetups xml:testsetups
\xmlsetsetup{test} {document|b|p|i|br|am} {xml:*}
\xmlsetsetup{test} {p[@class='tips']} {xml:tips}
\xmlsetsetup{test} {br[tag(1)='br']} {xml:brbr}
\xmlsetsetup{test} {div} {xml:div}
\xmlsetsetup{test} {input} {xml:input}
\xmlsetsetup{test} {input[@type='text']} {xml:inputtext}
\xmlsetsetup{test} {script|span} {xml:skip}
\xmlsetsetup{test} {div[@class='question']} {xml:question}
\xmlsetsetup{test} {div[@class='review']} {xml:review}
\stopxmlsetups
\xmlregistersetup{xml:testsetups}
\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:skip
\removeunwantedspaces\ignorespaces
\stopxmlsetups
\startxmlsetups xml:input
\stopxmlsetups
\startxmlsetups xml:inputtext
\blank
% \dontleavehmode\strut\blackrule[height=1pt,depth=0pt,width=\textwidth]
\dontleavehmode\underbar{\strut\char0\hskip\textwidth\strut}
\blank
\stopxmlsetups
\startxmlsetups xml:div
\blank
\xmlflush{#1}
\blank
\stopxmlsetups
\newcount\QuestionCounter
\startxmlsetups xml:question
\blank
\global\advance\QuestionCounter\plusone
\margintitle{\the\QuestionCounter}
\xmlflush{#1}
\blank
\stopxmlsetups
\startxmlsetups xml:review
% \blank
% \xmlflush{#1}
% \blank
\stopxmlsetups
*\startxmlsetups xml:am
\xmlprocessdata{}{
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mrow>
<msup> <mi>x</mi><mn>2</mn> </msup>
<mo>+</mo>
<mrow>
<mn>4</mn><mi>x</mi>
</mrow>
<mo>+</mo>
<mn>4</mn>
</mrow>
</math>
}{}
\stopxmlsetups
*
\startxmlsetups xml:br
\par
\stopxmlsetups
\startxmlsetups xml:p
\par
\stopxmlsetups
\startxmlsetups xml:tips
\blank
\bgroup\bf Tips: \egroup\xmlflush{#1}
\blank
\stopxmlsetups
\startxmlsetups xml:brbr
\blank
\stopxmlsetups
\startxmlsetups xml:i
\bgroup\it\xmlflush{#1}\egroup
\stopxmlsetups
\startxmlsetups xml:b
\bgroup\it\xmlflush{#1}\egroup
\stopxmlsetups
\starttext
\xmlprocessfile{test}{whatever-011.xml}{}
\stoptext
\stop
now, I need your help to use *<am></am>* value from input.xml and use it in
*\startxmlsetups xml:am* *\xmlprocessdata*as parameter.
Thanks
Anand
On Tue, Dec 21, 2010 at 5:03 PM, luigi scarso On Tue, Dec 21, 2010 at 10:01 AM, Hans Hagen On 21-12-2010 8:04, Anand Raj wrote: Hi, how to map svg tags from xml and tex file.? Dump the svg blob in a file (say image-1.svg) and then use
\extenalfigure[image-1.svg] to place it. Conversion to pdf will happen
automatically then
if you have inkscape installed --
luigi ___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to
the Wiki! maillist : ntg-context@ntg.nl /
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net ___________________________________________________________________________________
participants (6)
-
Anand Raj
-
Hans Hagen
-
Henning Hraban Ramm
-
luigi scarso
-
Thomas Schmitz
-
Wolfgang Schuster