Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
poppler
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adam Reichold
poppler
Commits
ec52e46e
Commit
ec52e46e
authored
Sep 04, 2011
by
Carlos Garcia Campos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xpdf303: Create annots with a doc instead of xref + catalog
parent
ce5e620f
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
274 additions
and
270 deletions
+274
-270
glib/poppler-action.cc
glib/poppler-action.cc
+1
-1
glib/poppler-annot.cc
glib/poppler-annot.cc
+2
-2
poppler/Annot.cc
poppler/Annot.cc
+183
-181
poppler/Annot.h
poppler/Annot.h
+65
-63
poppler/Catalog.cc
poppler/Catalog.cc
+3
-6
poppler/Form.cc
poppler/Form.cc
+12
-10
poppler/Form.h
poppler/Form.h
+6
-5
poppler/PSOutputDev.cc
poppler/PSOutputDev.cc
+1
-1
poppler/Page.cc
poppler/Page.cc
+1
-1
No files found.
glib/poppler-action.cc
View file @
ec52e46e
...
...
@@ -480,7 +480,7 @@ find_annot_movie_for_action (PopplerDocument *document,
if
(
annotObj
.
isDict
())
{
Object
tmp
;
annot
=
new
AnnotMovie
(
xref
,
annotObj
.
getDict
(),
document
->
doc
->
getCatalog
(),
&
tmp
);
annot
=
new
AnnotMovie
(
document
->
doc
,
annotObj
.
getDict
(),
&
tmp
);
if
(
!
annot
->
isOk
())
{
delete
annot
;
annot
=
NULL
;
...
...
glib/poppler-annot.cc
View file @
ec52e46e
...
...
@@ -199,7 +199,7 @@ poppler_annot_text_new (PopplerDocument *doc,
PDFRectangle
pdf_rect
(
rect
->
x1
,
rect
->
y1
,
rect
->
x2
,
rect
->
y2
);
annot
=
new
AnnotText
(
doc
->
doc
->
getXRef
(),
&
pdf_rect
,
doc
->
doc
->
getCatalog
()
);
annot
=
new
AnnotText
(
doc
->
doc
,
&
pdf_rect
);
return
_poppler_annot_text_new
(
annot
);
}
...
...
@@ -708,7 +708,7 @@ poppler_annot_markup_set_popup (PopplerAnnotMarkup *poppler_annot,
g_return_if_fail
(
POPPLER_IS_ANNOT_MARKUP
(
poppler_annot
));
annot
=
static_cast
<
AnnotMarkup
*>
(
POPPLER_ANNOT
(
poppler_annot
)
->
annot
);
popup
=
new
AnnotPopup
(
annot
->
get
XRef
(),
&
pdf_rect
,
(
Catalog
*
)
NULL
);
popup
=
new
AnnotPopup
(
annot
->
get
Doc
(),
&
pdf_rect
);
annot
->
setPopup
(
popup
);
}
...
...
poppler/Annot.cc
View file @
ec52e46e
This diff is collapsed.
Click to expand it.
poppler/Annot.h
View file @
ec52e46e
This diff is collapsed.
Click to expand it.
poppler/Catalog.cc
View file @
ec52e46e
...
...
@@ -116,11 +116,6 @@ Catalog::Catalog(PDFDoc *docA) {
// get the ViewerPreferences dictionary
catDict
.
dictLookup
(
"ViewerPreferences"
,
&
viewerPreferences
);
// perform form-related loading after all widgets have been loaded
if
(
getForm
())
getForm
()
->
postWidgetsLoad
(
this
);
catDict
.
free
();
return
;
...
...
@@ -871,7 +866,9 @@ Form *Catalog::getForm()
{
if
(
!
form
)
{
if
(
acroForm
.
isDict
())
{
form
=
new
Form
(
xref
,
&
acroForm
);
form
=
new
Form
(
doc
,
&
acroForm
);
// perform form-related loading after all widgets have been loaded
form
->
postWidgetsLoad
();
}
}
...
...
poppler/Form.cc
View file @
ec52e46e
...
...
@@ -34,6 +34,7 @@
#include "Dict.h"
#include "Gfx.h"
#include "Form.h"
#include "PDFDoc.h"
#include "XRef.h"
#include "PDFDocEncoding.h"
#include "Annot.h"
...
...
@@ -86,13 +87,13 @@ void FormWidget::print(int indent) {
}
#endif
void
FormWidget
::
createWidgetAnnotation
(
Catalog
*
catalog
)
{
void
FormWidget
::
createWidgetAnnotation
(
PDFDoc
*
docA
)
{
if
(
widget
)
return
;
Object
obj1
;
obj1
.
initRef
(
ref
.
num
,
ref
.
gen
);
widget
=
new
AnnotWidget
(
xref
,
obj
.
getDict
(),
catalog
,
&
obj1
,
field
);
widget
=
new
AnnotWidget
(
docA
,
obj
.
getDict
()
,
&
obj1
,
field
);
obj1
.
free
();
}
...
...
@@ -612,13 +613,13 @@ void FormField::fillChildrenSiblingsID()
}
}
void
FormField
::
createWidgetAnnotations
(
Catalog
*
catalog
)
{
void
FormField
::
createWidgetAnnotations
(
PDFDoc
*
docA
)
{
if
(
terminal
)
{
for
(
int
i
=
0
;
i
<
numChildren
;
i
++
)
widgets
[
i
]
->
createWidgetAnnotation
(
catalog
);
widgets
[
i
]
->
createWidgetAnnotation
(
docA
);
}
else
{
for
(
int
i
=
0
;
i
<
numChildren
;
i
++
)
children
[
i
]
->
createWidgetAnnotations
(
catalog
);
children
[
i
]
->
createWidgetAnnotations
(
docA
);
}
}
...
...
@@ -1241,11 +1242,12 @@ void FormFieldSignature::print(int indent)
// Form
//------------------------------------------------------------------------
Form
::
Form
(
XRef
*
xref
A
,
Object
*
acroFormA
)
Form
::
Form
(
PDFDoc
*
doc
A
,
Object
*
acroFormA
)
{
Object
obj1
;
xref
=
xrefA
;
doc
=
docA
;
xref
=
doc
->
getXRef
();
acroForm
=
acroFormA
;
size
=
0
;
...
...
@@ -1308,7 +1310,7 @@ Form::Form(XRef *xrefA, Object* acroFormA)
}
std
::
set
<
int
>
usedParents
;
rootFields
[
numFields
++
]
=
createFieldFromDict
(
&
obj2
,
xref
A
,
oref
.
getRef
(),
NULL
,
&
usedParents
);
rootFields
[
numFields
++
]
=
createFieldFromDict
(
&
obj2
,
xref
,
oref
.
getRef
(),
NULL
,
&
usedParents
);
obj2
.
free
();
oref
.
free
();
...
...
@@ -1394,7 +1396,7 @@ FormField *Form::createFieldFromDict (Object* obj, XRef *xrefA, const Ref& pref,
return
field
;
}
void
Form
::
postWidgetsLoad
(
Catalog
*
catalog
)
void
Form
::
postWidgetsLoad
(
)
{
// We create the widget annotations associated to
// every form widget here, because the AnnotWidget constructor
...
...
@@ -1402,7 +1404,7 @@ void Form::postWidgetsLoad (Catalog *catalog)
// a FormWidget the Catalog is still creating the form object
for
(
int
i
=
0
;
i
<
numFields
;
i
++
)
{
rootFields
[
i
]
->
fillChildrenSiblingsID
();
rootFields
[
i
]
->
createWidgetAnnotations
(
catalog
);
rootFields
[
i
]
->
createWidgetAnnotations
(
doc
);
}
}
...
...
poppler/Form.h
View file @
ec52e46e
...
...
@@ -29,9 +29,9 @@ class Dict;
class
Annot
;
class
AnnotWidget
;
class
Annots
;
class
Catalog
;
class
LinkAction
;
class
GfxResources
;
class
PDFDoc
;
enum
FormFieldType
{
formButton
,
...
...
@@ -106,7 +106,7 @@ public:
// decode id and retrieve pageNum and fieldNum
static
void
decodeID
(
unsigned
id
,
unsigned
*
pageNum
,
unsigned
*
fieldNum
);
void
createWidgetAnnotation
(
Catalog
*
catalog
);
void
createWidgetAnnotation
(
PDFDoc
*
docA
);
AnnotWidget
*
getWidgetAnnotation
()
const
{
return
widget
;
}
#ifdef DEBUG_FORMS
...
...
@@ -285,7 +285,7 @@ public:
// only implemented in FormFieldButton
virtual
void
fillChildrenSiblingsID
();
void
createWidgetAnnotations
(
Catalog
*
catalog
);
void
createWidgetAnnotations
(
PDFDoc
*
docA
);
#ifdef DEBUG_FORMS
void
printTree
(
int
indent
=
0
);
...
...
@@ -489,7 +489,7 @@ public:
class
Form
{
public:
Form
(
XRef
*
xref
A
,
Object
*
acroForm
);
Form
(
PDFDoc
*
doc
A
,
Object
*
acroForm
);
~
Form
();
...
...
@@ -511,11 +511,12 @@ public:
FormWidget
*
findWidgetByRef
(
Ref
aref
);
void
postWidgetsLoad
(
Catalog
*
catalog
);
void
postWidgetsLoad
();
private:
FormField
**
rootFields
;
int
numFields
;
int
size
;
PDFDoc
*
doc
;
XRef
*
xref
;
Object
*
acroForm
;
GBool
needAppearances
;
...
...
poppler/PSOutputDev.cc
View file @
ec52e46e
...
...
@@ -1453,7 +1453,7 @@ void PSOutputDev::writeDocSetup(PDFDoc *doc, Catalog *catalog,
if
((
resDict
=
page
->
getResourceDict
()))
{
setupResources
(
resDict
);
}
annots
=
new
Annots
(
xref
,
catalog
,
page
->
getAnnots
(
&
obj1
));
annots
=
new
Annots
(
doc
,
page
->
getAnnots
(
&
obj1
));
obj1
.
free
();
for
(
i
=
0
;
i
<
annots
->
getNumAnnots
();
++
i
)
{
if
(
annots
->
getAnnot
(
i
)
->
getAppearance
(
&
obj1
)
->
isStream
())
{
...
...
poppler/Page.cc
View file @
ec52e46e
...
...
@@ -349,7 +349,7 @@ Page::~Page() {
Annots
*
Page
::
getAnnots
()
{
if
(
!
annots
)
{
Object
obj
;
annots
=
new
Annots
(
xref
,
doc
->
getCatalog
()
,
getAnnots
(
&
obj
));
annots
=
new
Annots
(
doc
,
getAnnots
(
&
obj
));
obj
.
free
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment