omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    pdfkit PermissionError

    Pythonista
    pdfkit permissionerror pdf
    6
    7
    5399
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • uj_jonas
      uj_jonas last edited by uj_jonas

      I wanted to convert HTML to PDF and looked it on Google. I found the pdfkit docs, but when I tried using it

      import pdfkit
      
      pdfkit.from_url('https://google.com', sys.argv[0][:-7] + 'out.pdf')
      

      I got a PermissionError

      My guess is it's just iOS restricting me, but I'd like to know if I'm doing something wrong.

      1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by

        It seems that pdfkit uses a separately installed command-line tool to do the actual conversion. iOS doesn't allow apps to start other processes, which is why you get a PermissionError. And even if you could, the necessary program wouldn't be installed.

        1 Reply Last reply Reply Quote 0
        • uj_jonas
          uj_jonas last edited by

          Aww :/

          Well thanks for answering

          Phuket2 1 Reply Last reply Reply Quote 0
          • Phuket2
            Phuket2 @uj_jonas last edited by

            @uj_jonas , not sure , this post may help you though

            1 Reply Last reply Reply Quote 0
            • abcabc
              abcabc last edited by abcabc

              You can use reportlab module (no need to install, already included) to create pdf files. May be you can look at this tutorial to create simple pdf documents.

              http://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/

              For converting html to pdf , you may install xhtml2pdf package.

              1 Reply Last reply Reply Quote 0
              • omz
                omz last edited by

                In Python 2 mode, the xhtml2pdf module is already included.

                Yaroslav_Ya 1 Reply Last reply Reply Quote 0
                • Yaroslav_Ya
                  Yaroslav_Ya @omz last edited by

                  @omz but is there same package for Python 3 mode?

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB Forums | Contributors