Have bought and activated the Pro license for iOS.
I'm trying to render a PDF to image to be displayed in my app. This is working perfectly fine when I run the app in the xcode simulator.
However, I can't get the DIB image when running the app on actual hardware devices (iPhone 5S with iOS7 and iPad with iOS8).
Any help pls? Thanks in advance.
Are you experiencing the issue with our demo app too?
Which SDK version are you adopting?
If blank rendering is still present using our demo tool, may you provide one of your pdf file, please?
Send it opening a bug ticket in the support area.
In the description, put the full url from this forum thread.
Yes, the demo app does work on both the simulators and actual devices.
However when integrating it into our own app with the below code, we can't get the image when running on actual devices. The same code works perfectly inside the xcode simulator.
We're using iospdfviewer 3.3.3
Here are the code:
PDF_DOC PDFDoc = Document_openMem((void *)(data.bytes), size, nil, &err);
PDF_PAGE PDFPage = Document_getPage(PDFDoc, pageNo - 1);
float w = Document_getPageWidth(PDFDoc,pageNo - 1);
float h = Document_getPageHeight(PDFDoc,pageNo - 1);
PDF_DIB PDFdib = NULL;
PDF_DIB bmp = Global_dibGet(PDFdib, w * pageScale, h * pageScale);
PDF_MATRIX mat = Matrix_createScale(pageScale, -pageScale, 0, h * pageScale);
Page_renderPrepare( PDFPage, bmp );
Page_render(PDFPage, bmp, mat,false,1);
This code works in the simulator but not on actual devices.
When I comment out the last line Global_dibFree(bmp), it is now able to be displayed on actual devices.
However without that last line, the memory utilization increased tremendously, and the app/device will eventually crash when I open and close a complex PDF many times.