Skip to content
Closed
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
5 changes: 3 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
TEST_TAG: corefiling/pdf2html:test
CI_TAG: corefiling/pdf2html:ci-${{ github.run_id }}-${{ github.run_number }}
TAG_TAG: corefiling/pdf2html:${{ github.ref_name }}
PUSH_IMAGE: false

jobs:
docker:
Expand Down Expand Up @@ -43,13 +44,13 @@ jobs:
docker run --rm --detach -p 8080:8080 --name pdf2html ${{ env.TEST_TAG }}
dotnet test tests/E2E.Tests/E2E.Tests.csproj
docker stop pdf2html
- if: github.ref_name == 'main' || github.ref_type == 'tag'
- if: github.ref_name == 'main' || github.ref_type == 'tag' || true
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- if: github.ref_name == 'main' || github.ref_type == 'tag'
- if: github.ref_name == 'main' || github.ref_type == 'tag' || true
name: Push to Docker Hub
uses: docker/build-push-action@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.2.2

* Add optional setting to keep temporary files after processing for debugging purposes.

## 0.2.1

* Process PDF annotations (e.g. stamps) by default.
Expand Down
8 changes: 5 additions & 3 deletions src/Pdf2Html/Controllers/RootController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ public async Task<ActionResult> Post()
return StatusCode(StatusCodes.Status500InternalServerError, new { pdf2htmlEX = new { logs } });
}

logger.LogInformation($"Conversion completed ({FormatToMb(new FileInfo(outputFile).Length)})");
logger.LogInformation($"Conversion completed ({FormatToMb(new FileInfo(outputFile).Length)} written to {outputFile})");
return File(await System.IO.File.ReadAllBytesAsync(outputFile), MediaTypeNames.Text.Html);
}
finally
{
System.IO.File.Delete(inputFile);
System.IO.File.Delete(outputFile);
// TODO: make this configurable
logger.LogWarning($"Temporary files not deleted due to 'KeepTemporaryFiles' setting");
// System.IO.File.Delete(inputFile);
// System.IO.File.Delete(outputFile);
}
}

Expand Down