xhtml support in pisa v3.0.33

user220201

I am trying to convert html to pdf using pisa. I am using the following line of code -

pisa.CreatePDF(htmlCode, pdfFile, xhtml=True )

I get the following error. pdf creation failed with error 'module' object has no attribute 'XHTMLParser'

I have html5lib 1.0b3 installed. It used to work before but something happened (may be I updated some of the modules). So does any one know why I keep getting the above error?

When I do not pass the "xhtml=True", the call succeeds but the pdf generated is all wrong. Can I get around this somehow? Is it possible to convert a web page from xhtml to html?

How do I know whether a particular page is in xhtml or not?

The last two questions might not make sense because I do not write html code and can only read it.

Thanks for any help.

phihag

There is no XHTMLParser in html5parser, and the source code of pisa indicates that the xhtml=True flag is permanently broken:

if xhtml:
    #TODO: XHTMLParser doesn't see to exist...
    parser = html5lib.XHTMLParser(tree=treebuilders.getTreeBuilder("dom"))

Fortunately, XHTML is often valid HTML as well, so you don't need any conversion. Therefore, simply find out why the pdf generated is all wrong - XHTML is not the problem here.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

CSS parsing error when creating pdf with xhtml2pdf pisa.CreatePDF()

From Dev

How to get editable fields(form fields) when using xhtml2pdf/pisa?

From Dev

CSS parsing error when creating pdf with xhtml2pdf pisa.CreatePDF()

From Dev

How to support not well formed XHTML for XSLT

From Dev

How to support not well formed XHTML for XSLT

From Dev

Does Android Webview support Spdy V3?

From Dev

ADAL.NET v3 does not support AcquireToken with UserCredential?

From Dev

QuickBooks API v3 - support for Payment with DetailType of AccountBasedExpenseLineDetail

From Dev

Does Apache Olingo java library support OData V3?

From Dev

Does the youtube api v3/search support etags?

From Dev

Nokia In App Billing ( Error checking for billing v3 support )

From Dev

Does Apache Olingo java library support OData V3?

From Dev

Firebase SDK v3 for nodejs does not support `signInWithCustomToken(token)`

From Dev

ValueError: Maximum allowed size exceeded, variable will range from 0 to 3e33

From Dev

Install pisa on Ubuntu (django)

From Dev

Does the xhtml2pdf python library support the <img> tag?

From Dev

Does the xhtml2pdf python library support the <img> tag?

From Dev

Does Netbeans v8.0.2 plugin for cakephp support cakephp v3?

From Dev

Is there any workaround for WCF Data Services to bypass absence in OData V3 enum support?

From Dev

Can Glass.Mapper V3 support language fallback (field-level and item-level)?

From Dev

Dapper IPAddress/PhysicalAddress/Enum Parameter Support Over Npgsql v3

From Dev

passport-github support for Github's OAuth v3 APIs

From Dev

GoogleMaps API V3 Windows OS touch support for panning and pinch-to-zoom

From Dev

Errors "noscript", W3C XHTML

From Dev

AWS NodeJS SDK V3 DynamoDB UpdateItem - TypeError: Cannot read property '0' of undefined

From Dev

JavaServer Faces 2.2 and HTML5 support, why is XHTML still being used

From Dev

C# win. form - How to make XHTML support in webbrowser control?

From Dev

C# win. form - How to make XHTML support in webbrowser control?

From Dev

100% width split into 3* 33% divs

Related Related

  1. 1

    CSS parsing error when creating pdf with xhtml2pdf pisa.CreatePDF()

  2. 2

    How to get editable fields(form fields) when using xhtml2pdf/pisa?

  3. 3

    CSS parsing error when creating pdf with xhtml2pdf pisa.CreatePDF()

  4. 4

    How to support not well formed XHTML for XSLT

  5. 5

    How to support not well formed XHTML for XSLT

  6. 6

    Does Android Webview support Spdy V3?

  7. 7

    ADAL.NET v3 does not support AcquireToken with UserCredential?

  8. 8

    QuickBooks API v3 - support for Payment with DetailType of AccountBasedExpenseLineDetail

  9. 9

    Does Apache Olingo java library support OData V3?

  10. 10

    Does the youtube api v3/search support etags?

  11. 11

    Nokia In App Billing ( Error checking for billing v3 support )

  12. 12

    Does Apache Olingo java library support OData V3?

  13. 13

    Firebase SDK v3 for nodejs does not support `signInWithCustomToken(token)`

  14. 14

    ValueError: Maximum allowed size exceeded, variable will range from 0 to 3e33

  15. 15

    Install pisa on Ubuntu (django)

  16. 16

    Does the xhtml2pdf python library support the <img> tag?

  17. 17

    Does the xhtml2pdf python library support the <img> tag?

  18. 18

    Does Netbeans v8.0.2 plugin for cakephp support cakephp v3?

  19. 19

    Is there any workaround for WCF Data Services to bypass absence in OData V3 enum support?

  20. 20

    Can Glass.Mapper V3 support language fallback (field-level and item-level)?

  21. 21

    Dapper IPAddress/PhysicalAddress/Enum Parameter Support Over Npgsql v3

  22. 22

    passport-github support for Github's OAuth v3 APIs

  23. 23

    GoogleMaps API V3 Windows OS touch support for panning and pinch-to-zoom

  24. 24

    Errors "noscript", W3C XHTML

  25. 25

    AWS NodeJS SDK V3 DynamoDB UpdateItem - TypeError: Cannot read property '0' of undefined

  26. 26

    JavaServer Faces 2.2 and HTML5 support, why is XHTML still being used

  27. 27

    C# win. form - How to make XHTML support in webbrowser control?

  28. 28

    C# win. form - How to make XHTML support in webbrowser control?

  29. 29

    100% width split into 3* 33% divs

HotTag

Archive