added text value
This commit is contained in:
parent
740c0b193a
commit
4b95900b3a
1 changed files with 7 additions and 6 deletions
|
@ -8,9 +8,9 @@ class PDFFormFillerEditorView(View):
|
||||||
def get(self, request, pdf=""):
|
def get(self, request, pdf=""):
|
||||||
|
|
||||||
doc = poppler.document_new_from_file('file:///home/mark/Bedraga.pdf', password=None)
|
doc = poppler.document_new_from_file('file:///home/mark/Bedraga.pdf', password=None)
|
||||||
json = simplejson.dumps(list(self.get_fields(doc, 0)))
|
json = simplejson.dumps(list(self.get_fields(doc, 0)), indent=4)
|
||||||
|
|
||||||
return HttpResponse("response from editor view %s" % json)
|
return HttpResponse("<pre>" + json)
|
||||||
|
|
||||||
|
|
||||||
def load_poppler_doc(self, filename):
|
def load_poppler_doc(self, filename):
|
||||||
|
@ -29,11 +29,12 @@ class PDFFormFillerEditorView(View):
|
||||||
|
|
||||||
yield {
|
yield {
|
||||||
'name': field_data.get_name(),
|
'name': field_data.get_name(),
|
||||||
|
'value': field_data.text_get_text(),
|
||||||
'area': {
|
'area': {
|
||||||
'x1': field_area.x1,
|
'posx': field_area.x1,
|
||||||
'x2': field_area.x2,
|
'posy': field_area.y1,
|
||||||
'y1': field_area.y1,
|
'sizew': field_area.x2 - field_area.x1,
|
||||||
'y2': field_area.y2,
|
'sizeh': field_area.y2 - field_area.y1,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue