iclems / iOS-htmltopdf

MIT License
305 stars 79 forks source link

Crashes on iOS8.1 #27

Open gpdawson opened 9 years ago

gpdawson commented 9 years ago

I have been using this code for a while and it worked perfectly. However, when I try to run the same code on iOS8.1 there is a crash in the printToPDF function on the call to drawPageAtIndex.

Is anyone else seeing the same problem?

gpdawson commented 9 years ago

It looks like it is some kind of bug in iOS8, so likely nothing to do with NDHTMLtoPDF. For example see http://stackoverflow.com/questions/25822664/ios8-uiprintpagerenderer-hangs

iclems commented 9 years ago

Seems very similar to: https://github.com/brentnycum/BNHtmlPdfKit/issues/12 Have you figured out the origin?

gpdawson commented 9 years ago

I still haven't figured out the cause - nor found a workaround, despite using a tech support incident with Apple. It doesn't occur in all circumstances. If I create a minimal project to try to replicate the error, then it runs ok. It could relate to multi-threading (I run PDF generation in background). But I also get this same crash even when the PDF content is a single line of text, so pretty sure it's not related to #12.

gpdawson commented 9 years ago

It turns out that while this crashes in the simulator, it runs ok on a device. Hence clearly it's a simulator bug. Can't believe it took me so long to try this code on an actual device. :-/

seriyvolk83 commented 7 years ago

It does not work at all. Crashes without any reason.