Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about iOS development and PDF

addAnnotBitmap doesn't work in 2.2.0

More
IP: 192.168.0.71 11 years 10 months ago #6370 by Rossi
I tied to add an image to pdfview. I implemente the method
Code:
- (BOOL)addAnnotBitmap:(PDF_MATRIX)matrix :(CGImageRef)bitmap :(BOOL)has_alpha :(const PDF_RECT *)rect { return Page_addAnnotBitmap(m_page, matrix, bitmap, has_alpha, rect); }
but when i use it although it return true, no image is displayed and the annotation count not increase it value.

It is a bug or I did something wrong?
More
IP: 192.168.0.158 11 years 10 months ago #6371 by nermeen
Try using the following:
Code:
PDFPos pos = m_view.vGetPos((int)rects[0], (int)rects[1]);//where rect is in screen coordinate. PDFVPage vpage = m_view.vGetPage(pos.pageno); Matrix mat = vpage.CreateInvertMatrix(m_view.vGetX(), m_view.vGetY()); mat.TransformRect(rect); Page page = vpage.GetPage(); page.AddAnnotBitmap(bitmap, has_alpha, rect); mat.Destroy();

Then you need to rerender the page
More
IP: 192.168.0.71 11 years 10 months ago #6372 by Rossi
Sorry, i don't understand how to use your code.
- PDFPos return unknown type (i generally use PDFV_POS)
- how i should create rects
- Matrix is also unknown type and the method CreateInvertMatrix does not exist

Please can you explain me your code?
More
IP: 192.168.0.158 11 years 10 months ago #6373 by nermeen
Sorry that was for android, soon my colleague will send you the ios version
More
IP: 192.168.0.127 11 years 10 months ago #6374 by emanuele
Hi,

try to set cache path... something like:

NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
cachesPath = [cachesPath stringByAppendingPathComponent:@"file.dat"];
[m_doc setCache:cachesPath];

it must be set to add an image.

That procedure is already been explained in this old post:

www.androidpdf.mobi/forum/ios-dev/1213-h...uiimage?start=6#4370
More
IP: 192.168.0.71 11 years 10 months ago #6377 by Rossi
Hi, thank you for your reply. I not saw the old post.
I try with your tips and successfully add image on my pdfview but with same problem.
If i add a trasparent png it is inserted with black background.
Same time when i add the image the aplpication crashes on this function
-(bool)IsFinished
in PDFVPage with EXEC_BAD_ACCESS.
Time to create page: 0.386 seconds
Powered by Kunena Forum