template 'regular' and MS Word generated HTML

Showing 1-5 of 5 messages
template 'regular' and MS Word generated HTML MaDeuce 2/26/12 6:11 PM
I am new to xhtml2pdf and hope to be able to use it for bulk
conversion of html to pdf.  I have two newb questions...

1) After installing via pip in a virtualenv, I attempted to convert
pisa-en.html to pdf via: 'xhtml2pdf pisa-en.html'.  Doing so produces
an exception:
     "ValueError: can't find template('regular')".
The exception goes away and PDF is produced if I edit pisa-en.html and
remove the line containing '<pdf:nexttemplate name="regular"/>'.
What am I missing here?

2) My goal is to be able to convert HTML that was created by MS Word.
I know that's disgusting, but they are legacy files and have to be
converted.  I get errors on these as well, I assume having to do with
font incompatibility.  For example:
    File "/Users/khe/.virtualenvs/pat/lib/python2.7/site-packages/
xhtml2pdf/context.py", line 170, in atFontFace
    src = self.c.getFile(data["src"])
    KeyError: 'src'

I don't mind spending the time to dig in and find out what's going
on.  However, before doing so, I'd really appreciate it if someone
familiar with xhtml2pdf could weigh in and let me know the ultimate
goal is reasonable or not.  I'd hate to spend a couple of days on it,
only to find out that the MS generated HTML is hopeless.

Thanks very much,
--Ma
Re: template 'regular' and MS Word generated HTML Thiago Sousa Santos 2/4/14 8:24 PM
Any updates here?

I'm having the same issue, it seems it fails because it appends:

@font-face {font-family:'Courier New'; panose-1:2 7 3 9 2 2 5 2 4 4;}@font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0;}@font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0;}@font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} p.MsoNormal, li.MsoNormal, div.MsoNormal {margin-top:0cm; margin-right:0cm; margin-bottom:10.0pt; margin-left:0cm; line-height:115%; font-size:11.0pt; font-family:Calibri;}@page WordSection1 {size:595.3pt 841.9pt; margin:70.85pt 3.0cm 70.85pt 3.0cm;}div.WordSection1 {page:WordSection1;} ol {margin-bottom:0cm;}ul {margin-bottom:0cm;}

To the end of my CSS and that fails as the @font-face have no src property.

--
Thiago
 

Thanks very much,
--Ma
Re: [xhtml2pdf] Re: template 'regular' and MS Word generated HTML Philippe Raoult 2/5/14 12:42 PM
You need the src attribute because xhtmltopdf will load the fonts to
properly render the file.
> --
> You received this message because you are subscribed to the Google Groups
> "Pisa XHTML2PDF Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to xhtml2pdf+...@googlegroups.com.
>
> To post to this group, send email to xhtm...@googlegroups.com.
> Visit this group at http://groups.google.com/group/xhtml2pdf.
> For more options, visit https://groups.google.com/groups/opt_out.
Re: [xhtml2pdf] Re: template 'regular' and MS Word generated HTML Thiago Sousa Santos 2/5/14 12:50 PM
even when using a default font?


You received this message because you are subscribed to a topic in the Google Groups "Pisa XHTML2PDF Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xhtml2pdf/wlj3UNW_VPc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xhtml2pdf+...@googlegroups.com.

To post to this group, send email to xhtm...@googlegroups.com.
Visit this group at http://groups.google.com/group/xhtml2pdf.
For more options, visit https://groups.google.com/groups/opt_out.



--
Thiago Sousa Santos
Re: [xhtml2pdf] Re: template 'regular' and MS Word generated HTML Philippe Raoult 2/5/14 12:52 PM
I don't think calibri is the default for anyone else that Word.

See https://github.com/chrisglass/xhtml2pdf/blob/master/doc/usage.rst#fonts
for a list of fonts supported out of the box.