GithubHelp home page GithubHelp logo

yanezricardo / wkhtmltopdf.netcore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fpanaccia/wkhtmltopdf.netcore-deprecated

0.0 0.0 0.0 67.95 MB

Rotativa + Net Core

License: The Unlicense

C# 100.00%

wkhtmltopdf.netcore's Introduction

Wkhtmltopdf.NetCore

NuGet Publish Packages

This project implements the library wkhtmltopdf for asp net core, working in Windows, Linux, macOS and docker.

For more information about how to use it, go to https://github.com/fpanaccia/Wkhtmltopdf.NetCore.Example

But i don't want to see another repository

You will need to put this files with this following structure, this need to be done because nuget cant copy those files, only puts a link with the full path and will only work on your computer.

The structure will need to be on the folder of your project

    .
    ├── Example
    |   ├── Example.csproj
    |   └── Rotativa
    |   |   ├── Linux
    |   |   |   └── wkhtmltopdf
    |   |   ├── Mac
    |   |   |   └── wkhtmltopdf
    |   |   └── Windows
    |   |       └── wkhtmltopdf.exe
    └── Example.sln

Those files will need to be included in your project with the propierty "Copy Always", then add to your Startup.cs in ConfigureServices method, this line "services.AddWkhtmltopdf();", like this

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {            
        services.AddControllers();
        services.AddWkhtmltopdf();
    }

If you are using the docker container for net core provided from microsoft, you need to add this line to the dockerfile "RUN apt-get update -qq && apt-get -y install libgdiplus libc6-dev", like this

    FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
    WORKDIR /app
    RUN apt-get update -qq && apt-get -y install libgdiplus libc6-dev
    EXPOSE 80

In linux you also need to install the same libraries used in the dockerfile, they are libgdiplus, libc6-dev

For more information, see the example project -> https://github.com/fpanaccia/Wkhtmltopdf.NetCore.Example

wkhtmltopdf.netcore's People

Contributors

fpanaccia avatar ayiadim avatar biggray avatar bl4y avatar yanchihuang avatar gurustron avatar

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.