Last post Nov 19, 2013 06:44 AM by Shawn - MSFT
Nov 18, 2013 01:53 AM|Bulgarian|LINK
Hello. I'm trying to convert HTML to PDF using
BioPDF and printhtml.exe in C#.
I set print's settings each time, so I used runonce.ini - settings file, where I set output PDF - file, no preview, no "Show settings" - dialog and other settings. So, each time I saved the settings - file.
But when I tried with multiple convertion (multithreading, when I start multiple requests at the same time) - only the first request using my settings and other settings, BioPDF using global settings (in
global.ini). I think that first thread "lock" the file and other can't write in it.
I read in the BioPDF documentation (below the table) that bioPDF allow multiple conversions, when we set file's name after "runonce" in settings - file's name. But which file? Input HTML?
If I tried "runonce_1234-223F344G-3442GGRY-656S.ini" (because names of my files are GUIDS), BioPDF don't use this settings file and read from global.ini.
Can some of you have more information about it, or examples with multithreading?
I can show you my code.
Nov 19, 2013 06:44 AM|Shawn - MSFT|LINK
.NET has been designed from the start to support multi-threaded operation. There are two main ways of multi-threading which .NET encourages: starting your own threads with ThreadStart delegates, and using the ThreadPool class either directly
(using ThreadPool.QueueUserWorkItem) or indirectly using asynchronous methods (such as Stream.BeginRead , or calling BeginInvoke on any delegate).
For this situation, if you want to get more information about multithreading, you could refer to the following links:
Besides, about the usage of BioPDF, it's recommended that you could get further information here: