Subsequent PdfTools instances yield wrong PDF output
See original GitHub issueHi! I’m trying to write some automated tests.
If I:
using (var tools = new PdfTools())
{
var converter = new SynchronizedConverter(tools);
// do the stuff, many times over
}
…then everything works fine.
However, if I:
using (var tools = new PdfTools())
{
var converter = new SynchronizedConverter(tools);
// do the stuff
}
using (var tools = new PdfTools())
{
var converter = new SynchronizedConverter(tools);
// do the stuff
}
The “stuff” being done is a randomly-named temp folder being set up, a HTML file and CSS file being copied in and the HTML being converted. I’ve put breakpoints and verified that for each conversion, the HTML and CSS are all valid. It’s the PDF conversion bit which has the issue, for some reason!
…then only the first PDF is correct. Strangely, all of the subsequent PDFs simply have text in the source document dumped out.
The tests don’t run in parallel, it seems that using a second (or rather, non-first) PdfTools
instance is the issue.
Anything I can do to help diagnose?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Conversion Service
Once conversion is completed, the Conversion Service returns: Output document If the conversion was successful, the resulting document can be found in the ......
Read more >PDF processing and analysis with open-source tools
In case of broken or malformed files the output includes error ... A PDF can subsequently be tested against these rules (here in...
Read more >pdftools: Text Extraction, Rendering and Converting of PDF ...
The pdf_text function renders all textboxes on a text canvas and returns a character vector of equal length to the number of pages...
Read more >pdftk - A handy tool for manipulating PDF
Pdftk is a simple tool for doing everyday things with PDF documents. ... prompt you for a password if the supplied password is...
Read more >PDF Tools and How to View and Edit the Code ...
In this tutorial, we consider the PDF format and explore ways to view and edit its original source code. First, we take a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, it certainly seems so. But I’d have hoped that there would be an exception, rather than randomly-corrupted PDF output. If this is indeed a design restriction, could I suggest a static flag somewhere, such that subsequent calls to the constructors throw a helpful error message?
The PdfTools and Converter need to behave as singletons in your AppDomain.