Skip to content

Commit

Permalink
Merge pull request #3 from datalogics-saharay/PDF2IMG-173-part-2
Browse files Browse the repository at this point in the history
PDF2IMG-173: Expand Actions workflow to build/run samples with NuGet package
  • Loading branch information
datalogics-josepha authored Nov 29, 2023
2 parents 4443801 + e799cbf commit 345bdcd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test-nuget-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,36 @@ env:
jobs:
build-and-run-samples:
runs-on: windows-2022
strategy:
matrix: { dir: ['ConvertToJpg'] }
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build samples
working-directory: ${{ matrix.dir }}
run: dotnet build --configuration Release
- name: Run samples
working-directory: ${{ matrix.dir }}
run: dotnet run --configuration Release
- name: List files
run: |
ls ${{matrix.dir}}
- name: Save artifacts
uses: actions/upload-artifact@v3
with:
name: sample-output
path: |
${{matrix.dir}}\*.jpg
${{matrix.dir}}\*.jpeg
${{matrix.dir}}\*.eps
${{matrix.dir}}\*.tiff
${{matrix.dir}}\*.tif
${{matrix.dir}}\*.bmp
${{matrix.dir}}\*.png
${{matrix.dir}}\*.raw
${{matrix.dir}}\*.pdf
${{matrix.dir}}\*.gif
4 changes: 2 additions & 2 deletions ConvertToJpg/ConvertToJpg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
ImageConversionOptions options = new ImageConversionOptions();
options.OutputType = OutputType.JPEG;

uint numPages = pdf2img.LoadInput("input.pdf");
uint numPages = pdf2img.LoadInput("../Sample_Input/input.pdf");

pdf2img.SetImageConversionOptions(options);

pdf2img.ConvertPageToImage(1, "output.jpg");
pdf2img.ConvertPageToImage(1, "ConvertToJpg-output.jpg");
}
Binary file added Sample_Input/input.pdf
Binary file not shown.

0 comments on commit 345bdcd

Please sign in to comment.