Giter Club home page Giter Club logo

Comments (6)

AntoineLelaisant avatar AntoineLelaisant commented on June 10, 2024

Hello @Adelysnet!

Could you provide a reproducible gist or any equivalent ? It is hard tell what could be wrong with the information you currently provided.

Did you manage to spot anything that could help ?

from snappy.

Adelysnet avatar Adelysnet commented on June 10, 2024

Hi Antoine,

here is the Gist : https://gist.github.com/Adelysnet/8c52f20f06b82192aec4ecfb8e6cfd7f

Just call the generatePDF method like so :
$html = '<html><head><title>Test</title></head><body><h1>Test</h1></body></html>';

$pdfManager->generatePDF( $html );

Env :
PHP Version 8.1.16
Symfony : 5.4

Romain

from snappy.

qroques avatar qroques commented on June 10, 2024

Hi @Adelysnet ,

You wrote that "some times" the generation fails. Do you know every how many generation it fails?
I cannot reproduce what you are experiencing with a "filename" with a length longer than PHP_MAXPATHLEN

Do you have the message that triggered the 500 error code?

from snappy.

alexpozzi avatar alexpozzi commented on June 10, 2024

Hello @Adelysnet,
We can't replicate the issue you are having using your gist.
Are you sure your issue is related to the isFile function?
In your example you don't generate a filename that's slightly below the PHP_MAXPATHLEN but an header that's slightly below that length.
Are you sure that you don't have any issue reading/writing that file instead and, therefore, it's correct that theisFile function returns false?

from snappy.

Adelysnet avatar Adelysnet commented on June 10, 2024

Hi @alexpozzi
the header-html option pass the optionsWithContentCheck test in the Pdf class, so the value (can be html string or filename) is sent to the isFile function, which in my environnement crash.

from snappy.

alexpozzi avatar alexpozzi commented on June 10, 2024

Oh! You are right, my bad, I missed that.
Can you give us more info on your environment? Like OS, Docker version (if using Docker) etc...?
I think that the assertion should be adjusted in order to better support this case.

from snappy.

Related Issues (20)

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.