title: TCPDF very slow generation of dynamic arabic PDF
body: <p>I've been using a combination of nusoap &amp; TCPDF to ping a web service and dynamically fill out a PDF with content.</p>
  
  <p>The PDF itself (in english) takes around 8-9 seconds to complete for about 36 pages, some of which include bar charts.  I'd also like to note that due to the format that the data is received in, I am using "writeHTML" to present it on the PDF.</p>
  
  <p>My major issue came around when I started trying to generate the same PDFs with arabic translations.  I'm using the "Almohanad" font as described in the TCPDF examples, and the processing time jumped up to 2 minutes.</p>
  
  <p>I've tried using the following fix (which caches font files) : <a href="http://www.bitrealm.net/2010/08/tcpdf-is-slow-here-is-the-solution/" rel="nofollow">http://www.bitrealm.net/2010/08/tcpdf-is-slow-here-is-the-solution/</a> </p>
  
  <p>Alas it did not seem to work (the ".CACHED" file didn't appear even though I gave the tcpdf file full user permissions)!  I do have to mention that i needed to insert ob_clean() after the "require_once" section of my php file to avoid the following error: </p>
  
  <p>"TCPDF error: Some data has already been output, can't send PDF"</p>
  
  <p>I checked my php files for white space and found nothing out of place.</p>
  
  <p>In conclusion, could anyone help me speed up the generation of the arabic PDF using TCPDF, or else recommend a quicker alternative?</p>
  
  <p>Thanks for your time.</p>