Support images, .NET 8.0 and added options
Created a fork as I needed to create images with wkhtmltoimage in .NET 8.
- Add .NET 8 support;
- Support Partial views (
return new ViewAsPdf("MyPartialView", isPartialView = true); - Added
ViewAsImagebased on original Rotativa code; - Refactored
ViewAsPdf: use default ViewName, Model, ViewData and TempData properties instead of overriding them; - Removed
MasterNameas it wasn't used; - Added the
zoomparameter (as #54 has conflicts); - Fixed the tests by upgrading the deprecated iTextSharp to itext7.
- Added option to specify whether you want a Base URL to be added to the head in the HTML (fix for #88 ).
Also bumped the version to 1.4.0 and added manual test in Web App to verify that images are created (png and jpeg). A similar automated test as with Pdf (to check if a text inside the PDF is present) is not possible as it is an image.
@webgio What do you think of the proposed changes?
Added two unit tests based on existing Rotativa code that at least check for the image format.
Added some useful option flags, moved Zoom to AsResultBase (so it can be utilized by ViewAsImage as well), and added unit tests to verify that option flags are correctly passed to wkhtmltopdf/wkhtmltoimage.
This is the last commit for this PR before the review. @webgio Could you review the code?