Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC:

Calling AddAnnotRect returns FALSE 10 years 4 months ago #4571

  • rhill
  • rhill's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 21
  • Thank you received: 0
Hi there, we are using iOS SDK and am able to display a PDF, however using the addAnnotRect call is always returning FALSE.
- (void)addAnnotations {
	PDFPage *annotationPage = [m_doc page:0];
	
	if (annotationPage != nil) {
		PDF_RECT rect;

		rect.top = 175.0;
		rect.left = 284.0;
		rect.right = 470.0;
		rect.bottom = 524.0;

		[annotationPage objsStart];
		
		BOOL success = [annotationPage addAnnotRect:&rect: g_rect_Width: g_rect_color: 0];
		
		NSLog(@"success: %d", success);

		if (success) {
			NSLog(@"annotation added");
		} else {
			NSLog(@"annotation NOT added");
		}
	}
}

I have made sure the PDF file is writable.

In the app delegate I am calling:
	APP_Init();

And when I look at the definition of APP_Init() it seems that the Global_activePremium line is active (the others are commented out).

We have not yet licensed the SDK from you and so I've just followed the information in the iOS help file which tells me how to integrate the relevant files from the demo app into my project.

Please Log in or Create an account to join the conversation.

Calling AddAnnotRect returns FALSE 10 years 4 months ago #4575

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
Global_activePremium get package name inner.
and the operation is binding to the package name.

Please Log in or Create an account to join the conversation.

Calling AddAnnotRect returns FALSE 10 years 4 months ago #4578

  • rhill
  • rhill's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 21
  • Thank you received: 0
Thanks for the reply. Can I just clarify: are you saying that I need to change the package name passed to the Global_activePremium - i.e. change it to match the iOS bundle identifier I am using (com.fred.fred) OR do I need to change my iOS bundle identifier to match the one currently passed to Global_activePremium (com.radaee.pdf.PDFViewer)?

Please Log in or Create an account to join the conversation.

Calling AddAnnotRect returns FALSE 10 years 4 months ago #4579

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
APP_Init() in the demo project is binding to com.radaee.pdf.PDFViewer.

if you changed project package name to com.fred.fred, you need a license.
and need to modify codes of APP_Init().

Please Log in or Create an account to join the conversation.

Calling AddAnnotRect returns FALSE 10 years 4 months ago #4580

  • rhill
  • rhill's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 21
  • Thank you received: 0
Okay thanks for the reply, I'm really sorry but I'm not clear on what I need to change in APP_Init(), can you tell me?

Please Log in or Create an account to join the conversation.

Calling AddAnnotRect returns FALSE 10 years 4 months ago #4584

  • rhill
  • rhill's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 21
  • Thank you received: 0
It's okay, I guessed what you meant and set my bundle identifier to com.radaee.pdf.PDFViewer. The annotations now appear. Thanks

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum