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

Crash with bitmap annotation when saving as

More
IP: 192.168.0.70 12 years 1 month ago #5285 by jandrad
Hi

I've been having trouble with bitmap annotations when the document is saved into another file instead of the original.

I'm adding the bitmap annotation using this code:
Code:
PDFMatrix *mat = [vpage CreateMatrix]; UIImage * imgAdd = [UIImage imageNamed:@"image.png"]; PDF_RECT rect; float pdf_x = [vpage ToPDFX:x :[m_view vGetX]]; float pdf_y = [vpage ToPDFY:y :[m_view vGetY]]; rect.bottom = pdf_y - aWidth; rect.top = pdf_y + aWidth; rect.right =pdf_x + aHeight; rect.left =pdf_x - aHeight; [mat invert]; [mat transformRect:&rect]; [page addAnnotBitmap:mat.handle bitmap:imgAdd.CGImage alpha:YES rect:&rect];

The annotation is saved properly when using saving the document using Document_save(), however if I use Document_saveAs() the app crashes the next time the pdf is opened.

The steps I use to reproduce the issue are the following:

1. Open the original PDF file.
2. Save the a copy of the PDF file to another path.
3. Close the original PDF.
4. Open the created PDF for editing.
4. Add a bitmap annotation using the code mentioned earlier.
5. Save a copy of the created PDF file to another path.
6. Open the second copy, the app crashes.

Here are the original and generated PDFs and the crash log I'm getting when I try to open the generated PDF.

dl.dropboxusercontent.com/u/1634860/TestPDF.zip

Could anyone help me with this problem?
More
More
IP: 192.168.0.70 12 years 1 month ago #5392 by jandrad
Thank you emanuele, I can confirm it is not crashing anymore. However when I add a bitmap annotation on the saved pdf the first one does not contain alpha. If I add more than one the rest hast the alpha channel set correctly.

Could you help me with this?

Thanks again
More
IP: 192.168.0.70 12 years 1 month ago #5398 by radaee
just fixed, plz wait next version again.
More
IP: 192.168.0.151 12 years 1 month ago #5425 by emanuele
More
IP: 192.168.0.70 12 years 1 month ago #5444 by jandrad
I can confirm it is now working as expected.

Thank you!
Time to create page: 0.425 seconds
Powered by Kunena Forum