Code Monkey home page Code Monkey logo

php-weasyprint's People

Contributors

barryvdh avatar endelwar avatar mbabker avatar romainf avatar stephpy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

php-weasyprint's Issues

Weasyprint Process Timeout

Good day

I have a Codeigniter PHP web app that implements php-weasyprint. I sometimes (5% of the time) get the following error when a user generates a document:

The process "/usr/local/bin/weasyprint '/tmp/php_weasyprint6489782e31d4e8.37601559.html' '.../d9cb68c13f6489782e30fcf.pdf'" exceeded the timeout of 10 seconds.

I cannot seem to see why this happens. It is also interesting, because when the error appears, it is almost immediately after the quotation generation has been initiated, not 10 seconds later.

Is there any reason why this could be happening? I am not sure what code to share, but at least this is my document generator function:

`

          class Document_Generator
          {
              function create_pdf(
                  $html,
                  $complete_relative_path
              ) {
          
                  $pdf = new Pdf('/usr/local/bin/weasyprint');
                  if (file_exists($complete_relative_path)) {
                      unlink($complete_relative_path);
                  }
                  return $pdf->generateFromHtml($html, $complete_relative_path);
              }
          }

`

My image isn't appearing

Hello

Initially I was thinking this might be a WeasyPrint issue, but the command line version is working correctly.
Here are a couple of real URLs as examples you can play with.

First a real image that will work:
https://sobs.com.au/docs/pix/simple-example.png

Second, a secure image retrieval that doesn't produce any image (but it does work when using WeasyPrint from the command line):
https://sobs.com.au/ui/fap.php?fap=WyJub3RpY2VBdHRhY2htZW50Iiw3NjI5MjksIi4uXC91cGxvYWRzXC8xNVwvbm90aWNlc1wvMjAyM1wvMDVcLzc2MjkyOV8xNjg0MTQwOTE5XzEuanBnIl0

Cheers
Murray

php unit testing

Hello

I'm trying to implement some php unit testing around my PDF generation.
I can easily check the creation of the PDF document, but if I want to ensure it contains the text I'm looking for, formatted in a similar manner, I'm having trouble.

I found this article (https://stackoverflow.com/questions/32489513/software-testing-a-pdf-is-created-correctly) which suggested generating the PDF and comparing it to a previously generated PDF, which I tried, but it didn't work. Even though both contained exactly the same content the strings were never the same.

Do you have any suggestions how I might be able to ensure my PDF contains the correct content?

weasyprint: error: unrecognized arguments: --format

The exit status code '2' says something went wrong:
stderr: "usage: weasyprint [-h] [--version] [-i] [-e ENCODING] [-s STYLESHEET]
[-m MEDIA_TYPE] [-u BASE_URL] [-a ATTACHMENT] [-p]
[-O {images,fonts,all,none}] [-v] [-d] [-q]
input output
weasyprint: error: unrecognized arguments: --format C:\Users\AEM\AppData\Local\Temp\php_weasyprint61cbe3514c1101.17556704.pdf
"
stdout: ""
command: C:\Users\AEM\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts\weasyprint.exe --format pdf "http://www.github.com" "C:\Users\AEM\AppData\Local\Temp\php_weasyprint61cbe3514c1101.17556704.pdf".

if i run in command line , i get same error

when i run this command is ok
weasyprint https://example.com weasyprint-website.pdf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.