Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,7 @@ For more information about how to use it, go to https://github.com/fpanaccia/Wkh

# 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
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)
Expand Down
1 change: 1 addition & 0 deletions Wkhtmltopdf.NetCore/Wkhtmltopdf.NetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ For more information about how to use it, go to https://github.com/fpanaccia/Wkh

<ItemGroup>
<None Include="build\net5.0\*" Pack="true" PackagePath="build\netcoreapp3.0" />
<None Include="build\*.props" Pack="true" PackagePath="build" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 14 additions & 0 deletions Wkhtmltopdf.NetCore/build/Wkhtmltopdf.NetCore.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project>
<Target Name="CopyFilesToBuild" BeforeTargets="Build">
<ItemGroup>
<Files Include="$(MSBuildThisFileDirectory)../Rotativa/**/*.*"></Files>
</ItemGroup>
<Copy SourceFiles="@(Files)" DestinationFolder="$(OutputPath)\Rotativa\%(RecursiveDir)" />
</Target>
<Target Name="CopyFilesToPublish" AfterTargets="AfterPublish">
<ItemGroup>
<Files Include="$(MSBuildThisFileDirectory)../Rotativa/**/*.*"></Files>
</ItemGroup>
<Copy SourceFiles="@(Files)" DestinationFolder="$(PublishDir)\Rotativa\%(RecursiveDir)"/>
</Target>
</Project>