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

Saving text to the pdf

More
9 years 7 months ago - 9 years 7 months ago #11775 by valkuz1
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.
Last edit: 9 years 7 months ago by valkuz1.
More
9 years 7 months ago - 9 years 7 months ago #11776 by valkuz1
Replied by valkuz1 on topic Saving text to the pdf
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.
Last edit: 9 years 7 months ago by valkuz1.
More
9 years 7 months ago #11779 by emanuele
Replied by emanuele on topic Saving text to the pdf
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.
More
9 years 7 months ago #11785 by valkuz1
Replied by valkuz1 on topic Saving text to the pdf
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.
More
9 years 7 months ago #11786 by support
Replied by support on topic Saving text to the pdf
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 .
Time to create page: 0.437 seconds
Powered by Kunena Forum