Skip to content

Repository files navigation

PDFjsSharp

NugetBuildDonate

Brings PDF.js to .net

Feature

  • Renders each page of a PDF to PNGs

Dependencies

get

  • NodeJs
    • node 20 or 22 x64 (older node versions are supported by older PDFjsSharp versions)

HowTo use

usingvarrasterizer=newRasterizer();varactualImages=awaitrasterizer.ConvertToPngAsync(@"../../../SourceTest.pdf",actualImagePath);Assert.Equal(1,actualImages.Count);

Development

get .net 8 sdk

Upgrade npm packages

  • npx npm-check --update-all --skip-unused

Steps to update node_modules.win.*.zip

 cd .\PdfjsSharp\
nvm install 22;nvm use 22;rm -R .\node_modules\;npm install --omit=dev;rm .\node_modules.win.node22.zip;Compress-Archive-LiteralPath .\node_modules\ -DestinationPath .\node_modules.win.node22.zip;Compress-Archive-Update .\Rasterize.mjs .\node_modules.win.node22.zip

Ubuntu 22.04

#In case you have no nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash exit
nvm install 22
sudo apt install dotnet8 zip

Steps to update node_modules.linux.node*.zip

nvm install 22
nvm use 22
rm -R ./node_modules/ npm install --omit=dev && rm node_modules.linux.node22.zip && zip -r node_modules.linux.node22.zip node_modules && zip -g node_modules.linux.node22.zip Rasterize.mjs

About

Brings Pdfjs to .net

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages