GithubHelp home page GithubHelp logo

Comments (6)

fpanaccia avatar fpanaccia commented on July 24, 2024

Hi!, i think you could, without any modification in the library, you could do something like this in the startup

services.AddWkhtmltopdf("PATH_TO_SYSTEM_WIDE_VERSION");

from wkhtmltopdf.netcore-deprecated.

joa77 avatar joa77 commented on July 24, 2024

Unfortunately the WkhtmlDriver class hardcodes an operating system directory to the wkhtmltopdf path.

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                rotativaLocation = Path.Combine(wkhtmlPath, "Windows", "wkhtmltopdf.exe");
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                rotativaLocation = Path.Combine(wkhtmlPath, "Mac", "wkhtmltopdf");
            }
            else
            {
                rotativaLocation = Path.Combine(wkhtmlPath, "Linux", "wkhtmltopdf");
            }

For example, it is not possible for the binary file to be located under /usr/local/bin/wkhtmltopdf

from wkhtmltopdf.netcore-deprecated.

fpanaccia avatar fpanaccia commented on July 24, 2024

Yeah, i forgot about those lines, the online way i think it could work is with a few modifications

from wkhtmltopdf.netcore-deprecated.

fpanaccia avatar fpanaccia commented on July 24, 2024

i think im gonna add a parameter in the setup like "usesystemwide" or something like that....and invoke wkhtmltopdf, the only catch is that the path to wkhtmltopdf will have to be added to the env variable PATH

from wkhtmltopdf.netcore-deprecated.

gurustron avatar gurustron commented on July 24, 2024

@fpanaccia

Also there are line in AddWkhtmltopdf: RotativaPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, wkhtmltopdfRelativePath); This can be worked around with setting static variable after the call, but then there are lines as OP described.

I'm planning to implement such feature in my fork. We can collaborate on that. I think user should be able to provide full path to executable, also I suggest removing the static path from settings.

from wkhtmltopdf.netcore-deprecated.

fpanaccia avatar fpanaccia commented on July 24, 2024

Hi @gurustron! yes, i had planned to do that in the weekend, i have little time available as this moment, if you have the time, please, be my guest

from wkhtmltopdf.netcore-deprecated.

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.