- Posts: 25
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Development and suggestions about third part tool integration.
Cordova, Xamarin, Basic4Android topics are listed here.
Cordova, Xamarin, Basic4Android topics are listed here.
Retrieve Acrofield Status
IP: 93.34.225.185
7 years 10 months ago #13785
by mfranc28
Retrieve Acrofield Status was created by mfranc28
I'd like to know how I can get the modded acrofield from my PDF.
With my previous library I retrieve an Hastable of this field.
With my previous library I retrieve an Hastable of this field.
IP: 212.97.62.176
7 years 10 months ago #13787
by nermeen
Replied by nermeen on topic Retrieve Acrofield Status
We are not sure that we understand your request, probably this is not supported.
But if you can send us an example pdf (better with the expected result), we can give you a more definitive answer.
But if you can send us an example pdf (better with the expected result), we can give you a more definitive answer.
IP: 93.34.225.185
7 years 10 months ago #13788
by mfranc28
Replied by mfranc28 on topic Retrieve Acrofield Status
I try the Doc.Save of a Offline document but without result. The PDF next time I open it it be blank, without my update.
I found also how I can take all modded acrofield with this code:
for (int i = 0; i < rPdfDoc.PageCount; i++)
{
Com.Radaee.Pdf.Page page = rPdfDoc.GetPage(i);
page.ObjsStart();
for (int j = 0; j < page.AnnotCount; j++)
{
Annotation annot = page.GetAnnot(j);
annot.ReadOnly = true;
}
page.Close();
}
But I can't understand if this give me only the modded acrofield or all acrofield.
Finally in attach there is my test PDF. I want to open PDF, modify some field and checkbox, the sign and save all my work. Next time I open this PDF must have all my previous update, at the moment no problem with the sign, my problem is with the acrofield.
Thanks
I found also how I can take all modded acrofield with this code:
for (int i = 0; i < rPdfDoc.PageCount; i++)
{
Com.Radaee.Pdf.Page page = rPdfDoc.GetPage(i);
page.ObjsStart();
for (int j = 0; j < page.AnnotCount; j++)
{
Annotation annot = page.GetAnnot(j);
annot.ReadOnly = true;
}
page.Close();
}
But I can't understand if this give me only the modded acrofield or all acrofield.
Finally in attach there is my test PDF. I want to open PDF, modify some field and checkbox, the sign and save all my work. Next time I open this PDF must have all my previous update, at the moment no problem with the sign, my problem is with the acrofield.
Thanks
IP: 212.97.62.176
7 years 10 months ago #13791
by nermeen
Replied by nermeen on topic Retrieve Acrofield Status
If you are opening the pdf from stream, Document.Save will save the modification to the byte array. So you will need to re-write the byte array into the file system (check the below code)
The above code will get all types of annotations, you will need to filter them based on type, maybe also field name.. use something like the following:
You can also check
www.radaeepdf.com/documentation/javadocs...ation.html#GetType--
The above code will get all types of annotations, you will need to filter them based on type, maybe also field name.. use something like the following:
Code:
Document document = new Document();
PDFMemStream memStream = new PDFMemStream(File.ReadAllBytes(path));
if(document.OpenStream(memStream, "") == 0)
{
for(int i = 0; i < document.PageCount; i++)
{
Page page = document.GetPage(i);
page.ObjsStart();
for (int j = 0; j < page.AnnotCount; j++)
{
Page.Annotation annot = page.GetAnnot(j);
if (annot.EditType > 0 && annot.FieldName.Equals("Text3"))
{ //edit form
annot.SetEditText("New string");
} else if(annot.CheckStatus >= 0)
{ //cehck box
} else if (annot.ComboItemCount >= 0)
{ //combo box
}
}
page.Close();
}
}
document.Save();
document.Close();
File.WriteAllBytes(path, memStream.Get_data());
IP: 93.34.225.185
7 years 10 months ago #13822
by mfranc28
Replied by mfranc28 on topic Retrieve Acrofield Status
I don't understand why it doesn't work.
My code Is attached.
Note: variable memStream is my current opened pdf in viewer
Please can you help me understand where I did a mistake?
My code Is attached.
Note: variable memStream is my current opened pdf in viewer
Please can you help me understand where I did a mistake?
IP: 37.183.44.177
7 years 10 months ago #13823
by nermeen
Replied by nermeen on topic Retrieve Acrofield Status
We've checked your code, but couldn't test it as it's not complete.
It seems ok, make sure to activate the premium license before invoking this code, and that all the set methods returns true.
Also the document.Save returns true.
It seems ok, make sure to activate the premium license before invoking this code, and that all the set methods returns true.
Also the document.Save returns true.
Time to create page: 0.429 seconds