- Posts: 1123
- Thank you received: 73
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Compiling PDF forms
IP: 192.168.0.71
11 years 4 months ago #7230
by radaee
Replied by radaee on topic Compiling PDF forms
have you any screen shot?
i guess the clipped text are out of edit border.
i guess the clipped text are out of edit border.
IP: 192.168.0.71
11 years 4 months ago - 11 years 4 months ago #7231
by radaee
Replied by radaee on topic Compiling PDF forms
it seems works fine in demo project, as below operations:
1. edit text field, and type some words, then exit editing.
2. edit the text field again, then exit editing.
3. click "save" button.
4. click "close" button.
5. reopen the PDF file again, the text shows fine.
NOTICE: do not type long texts out of text border.(means do not type text cause text-box to be scroll)
1. edit text field, and type some words, then exit editing.
2. edit the text field again, then exit editing.
3. click "save" button.
4. click "close" button.
5. reopen the PDF file again, the text shows fine.
NOTICE: do not type long texts out of text border.(means do not type text cause text-box to be scroll)
Last edit: 11 years 4 months ago by .
IP: 192.168.0.71
11 years 4 months ago #7235
by noberasco
Replied by noberasco on topic Compiling PDF forms
Hi,
here are the screenshots (from within my own application):
1) dl.dropboxusercontent.com/u/7172743/Screenshots/screen.png
2) dl.dropboxusercontent.com/u/7172743/Screenshots/screen2.png
3) dl.dropboxusercontent.com/u/7172743/Screenshots/screen3.png
Screenshot 1 depicts my document just after entering a value in the text field. you see the same when exiting and reentering the document.
Screenshot 2 depicts my document just after editing the same text field again.
In screenshot 3 I just closed and reopened the document, without changing it any further.
As you can see, text in screenshot 3 is just weird, as it only displays a portion of the supposed text.
If, at this point, I tap and re-edit the same field, while editing I see the full value.
here are the screenshots (from within my own application):
1) dl.dropboxusercontent.com/u/7172743/Screenshots/screen.png
2) dl.dropboxusercontent.com/u/7172743/Screenshots/screen2.png
3) dl.dropboxusercontent.com/u/7172743/Screenshots/screen3.png
Screenshot 1 depicts my document just after entering a value in the text field. you see the same when exiting and reentering the document.
Screenshot 2 depicts my document just after editing the same text field again.
In screenshot 3 I just closed and reopened the document, without changing it any further.
As you can see, text in screenshot 3 is just weird, as it only displays a portion of the supposed text.
If, at this point, I tap and re-edit the same field, while editing I see the full value.
IP: 192.168.0.71
11 years 4 months ago #7237
by radaee
Replied by radaee on topic Compiling PDF forms
it is really strange.
here is my test result:
first edit
second edit
save and reopen.
here is result PDF file:
www.radaee.com/files/edited.pdf
here is my test result:
first edit
second edit
save and reopen.
here is result PDF file:
www.radaee.com/files/edited.pdf
IP: 192.168.0.71
11 years 4 months ago #7238
by noberasco
Replied by noberasco on topic Compiling PDF forms
In order to also let you understand what I'm doing, here follows a (simplified) version of the source code in question.
Code:
public void OnAnnotClicked(PDFVPage vPage, final Page.Annotation annotation) {
if (annotation.GetFieldType() == 2) {
int editType = annotation.GetEditType();
int maxLen = annotation.GetEditMaxlen();
boolean singleLine = (editType != 3);
Log.w("Siemens PDF", "Free text annotation has type " + editType + " and max len " + maxLen);
final EditText input = new EditText(this);
final AlertDialog dialog = new AlertDialog.Builder(this)
.setTitle(annotation.GetFieldFullName())
.setView(input)
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
Editable value = input.getText();
String fieldName = annotation.GetFieldFullName();
String newValue = value.toString();
m_reader.PDFEndAnnot();
annotation.SetEditText(newValue);
if (m_doc.CanSave() == true) {
m_doc.Save();
}
m_reader.PDFRedrawPage(vPage);
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// Do nothing.
m_reader.PDFEndAnnot();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialogInterface) {
m_reader.PDFEndAnnot();
}
}).create();
input.setText(annotation.GetEditText());
input.setSelection(input.getText().length());
input.setSingleLine(singleLine);
if (maxLen > 0) {
input.setFilters(new InputFilter[] {new InputFilter.LengthFilter(maxLen)});
}
input.setImeOptions(input.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
input.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
dialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick();
return true; // consume.
}
return false; // pass on to other listeners.
}
});
dialog.show();
}
}
IP: 192.168.0.71
11 years 4 months ago #7239
by radaee
Replied by radaee on topic Compiling PDF forms
i not know what this happen.
now you can try:
modify Global.Init()
where
change to:
just try it.
now you can try:
modify Global.Init()
where
Code:
// set text font for edit-box and combo-box editing.
if (!setAnnotFont("DroidSansFallback") && face_name != null) {
setAnnotFont(face_name);
}
Code:
// set text font for edit-box and combo-box editing.
if (!setAnnotFont("Roboto-Regular") && face_name != null) {
setAnnotFont(face_name);
}
Time to create page: 0.393 seconds