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

TOPIC:

Saving text to the pdf 7 years 2 months ago #11775

  • valkuz1
  • valkuz1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 13
  • Thank you received: 0
I am working on the integrating of this library to some of our projects,

however, unfortunately, I've ran into the following issue:

When I try to save the text (I have a PDF with AcroForm text fields) to the PDF, it does not get saved.
It also does not work in the provided Demo Project.

More details:

This is the code from your demo project, which I reuse as well.
When you finish editing, this method gets called:

#pragma mark - textField Delegate
- (void)textFieldDidEndEditing:(UITextField *)textField;
{
NSLog(@"textView.text = %@",textField.text);
[m_view setEditBoxWithText:textField.text];
}

Subsequently, here is the body of this method:

- (void)setEditBoxWithText:(NSString *)text
{
[m_annot setEditText:text];
[m_view vRenderSync:m_annot_pos.pageno];
[m_doc save]; // returns true!
[self vAnnotEnd];
}

However, unfortunately, nothing is saved to the pdf file.
At the same time, I am able to draw and it gets saved to the pdf succesfully.

What could be the reason?

Thanks.

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

Last edit: by valkuz1.

Saving text to the pdf 7 years 2 months ago #11776

  • valkuz1
  • valkuz1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 13
  • Thank you received: 0
More info,



When I write some text in the textfield and press ENTER (being on the simulator), the text is saved to the PDF.
But when I click on the pdf instead, it is not saved.
Behaviour of the methods mentioned above is the same.

Probably, it can give you some clues, such as tapping removes some focus and setEditBoxWithText does not work as expected


So, it is not about the actual saving to the doc, but about the PDFView instead.

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

Last edit: by valkuz1.

Saving text to the pdf 7 years 2 months ago #11779

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,

this is the standard behaviour of the demo project: when you tap the pdf page, the vAnnotEnd method of PDFView class is called (in OnAnnotTouchEnd method), and the selected annotation (in this case the editText) lose the focus without calling the save method.
Tapping the "enter" button, the save method is called before the vAnnotEnd keeping the changes of the editText
To reach your needs you can modify the OnAnnotTouchEnd method to save the editText also in this case.

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

Saving text to the pdf 7 years 2 months ago #11785

  • valkuz1
  • valkuz1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 13
  • Thank you received: 0
Yeah, did this, fortunately you have UI logic implemented and opensource. thanks for your quick reply. On a side note, I think it is a default behaviour while filling fields - to tap out of a field and do not expect the text to be disappearing.

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

Saving text to the pdf 7 years 2 months ago #11786

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 692
  • Thank you received: 59
We're working on a new revamped version of iOS's framework.
If you've suggestions, please write them opening a new thread here www.radaeepdf.com/forum/What-do-you-like...t-PDFViewer-releases.

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

  • Page:
  • 1
Powered by Kunena Forum