<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>Debenu Quick PDF Library - PDF SDK Community Forum : Multi-Threading from C#</title>
  <link>http://www.quickpdf.org/forum/</link>
  <description><![CDATA[This is an XML content feed of; Debenu Quick PDF Library - PDF SDK Community Forum : General Discussion : Multi-Threading from C#]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 05 May 2026 22:46:44 +0000</pubDate>
  <lastBuildDate>Tue, 01 Aug 2017 11:50:28 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 11.01</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.quickpdf.org/forum/RSS_post_feed.asp?TID=3487</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Debenu Quick PDF Library - PDF SDK Community Forum]]></title>
   <url>http://www.quickpdf.org/forum/forum_images/QPDF_Forum_Title.png</url>
   <link>http://www.quickpdf.org/forum/</link>
  </image>
  <item>
   <title><![CDATA[Multi-Threading from C# : Thanks for the reply.I tested...]]></title>
   <link>http://www.quickpdf.org/forum/multithreading-from-c_topic3487_post13872.html#13872</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=2967">davidgm</a><br /><strong>Subject:</strong> 3487<br /><strong>Posted:</strong> 01 Aug 17 at 11:50AM<br /><br />Thanks for the reply.<br><br>I tested 4 different threads, each one printing to a different printer, and each printer from a diferent manufacturer with a different driver. It failed.<br><br>I tested with spooling enabled &amp; disabled, and with the spooler set to print immediately and set to print after last page has been spooled. Everything failed.<br><br>Print processor was set to winprint &amp; raw in all the cases.<br><br>If you use a lock() with a critical section before the PrintDocument, it works ofc, but you lose all the multi-core boost this way.<br><br>So far, the best solution for multi-core printing is a little helper (print.exe) that runs in a separate process. This way it works, even sending many jobs to the same printer at the same time.<br><br>I have been testing many different libraries from different companies, and this library is the best by far in terms of printing speed.<br>]]>
   </description>
   <pubDate>Tue, 01 Aug 2017 11:50:28 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/multithreading-from-c_topic3487_post13872.html#13872</guid>
  </item> 
  <item>
   <title><![CDATA[Multi-Threading from C# : Surely it is more likely that...]]></title>
   <link>http://www.quickpdf.org/forum/multithreading-from-c_topic3487_post13871.html#13871</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1388">tfrost</a><br /><strong>Subject:</strong> 3487<br /><strong>Posted:</strong> 31 Jul 17 at 9:14AM<br /><br />Surely it is more likely that the printing operation is the part that does not support multi-threading? &nbsp;It could be an issue with the printer driver. &nbsp;Are both threads attempting to write to the same physical printer? Is spooling enabled and working for the printer port? &nbsp;Google tells me that&nbsp;<span style=": rgb251, 251, 253;">0x80004005 can arise when sharing a printer, but it is hard to find a definitive meaning for this code.&nbsp;</span><div><br></div><div>A simpler solution than using a separate program might be to enclose the call to PrintDocument inside a critical section, especially if printing to the same printer is likely.</div>]]>
   </description>
   <pubDate>Mon, 31 Jul 2017 09:14:48 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/multithreading-from-c_topic3487_post13871.html#13871</guid>
  </item> 
  <item>
   <title><![CDATA[Multi-Threading from C# : Hello,I am facing several issues...]]></title>
   <link>http://www.quickpdf.org/forum/multithreading-from-c_topic3487_post13870.html#13870</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=2967">davidgm</a><br /><strong>Subject:</strong> 3487<br /><strong>Posted:</strong> 28 Jul 17 at 5:32PM<br /><br />Hello,<br><br>I am facing several issues using threads in C# with this library.<br><br>I know that the library is not multi-thread safe, but i also did read this:<br><br>"However, Debenu Quick PDF Library can be used in a multi-threaded environment so long as a separate instance of the library is created by each thread."<br><br>I create different threads in my C#, and i init the library this way in every thread:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Foxit(string KEY)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Different filename for 32-bit and 64-bit DLL<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string DLLprefix = "DebenuPDFLibraryDLL";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string DLL64prefix = "DebenuPDFLibrary64DLL";<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string dllName;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Check to see if IntPtr size is 4.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // If 4 then it's 32-bit, if 8 then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // it is 64-bit.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (IntPtr.Size == 4)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dllName = DLLprefix + VERSION.ToString("D4") + ".DLL"; // 32 bits<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dllName = DLL64prefix + VERSION.ToString("D4") + ".DLL"; // 64 bits<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Load the library<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DPL = new PDFLibrary(dllName);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Unlock the library<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_started = DPL.UnlockKey(KEY) == 1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>However, when several threads are using the library, i get the following exception:<br><br>Excepcion: System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.<br>&nbsp;&nbsp; in DebenuPDFLibraryDLL1312.PDFLibrary.PrintDocument(String PrinterName, Int32 StartPage, Int32 EndPage, Int32 Options)<br><br>The method causing the exception is PrintDocument, and this is what i'm using from the lib.<br><br>I solved the problem temporarily by creating a little executable that does the printing part only. I do a shell exec from each thread to this executable. It is not optimal, but it is working properly, and i get the multi-core boost that i need for my application. Speed is crucial for my project.<br><br>Am i missing any special initialization for a muti-threaded C# application ?<br><br>Thank you very much.<br>]]>
   </description>
   <pubDate>Fri, 28 Jul 2017 17:32:12 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/multithreading-from-c_topic3487_post13870.html#13870</guid>
  </item> 
 </channel>
</rss>