draw AP widget to js, separation of AP widgets drawing

This commit is contained in:
Kulikova Svetlana
2023-03-21 16:26:05 +03:00
parent 84f8a65cd5
commit 9a827d9c14
10 changed files with 133 additions and 55 deletions

View File

@ -31,6 +31,7 @@
#include "UTF8.h"
#include "PDF417Barcode.h"
#include "AcroForm.h"
#include "GlobalParams.h"
//------------------------------------------------------------------------
@ -561,7 +562,10 @@ void AcroForm::scanField(Object *fieldRef) {
void AcroForm::draw(int pageNum, Gfx *gfx, GBool printing) {
int i;
int formField = globalParams->getDrawFormField();
for (i = 0; i < fields->getLength(); ++i) {
if (formField >= 0 && formField != i)
continue;
((AcroFormField *)fields->get(i))->draw(pageNum, gfx, printing);
}
}

View File

@ -754,6 +754,7 @@ GlobalParams::GlobalParams(const char *cfgFileName) {
printCommands = gFalse;
errQuiet = gFalse;
debugLogFile = NULL;
drawFormField = -1;
cidToUnicodeCache = new CharCodeToUnicodeCache(cidToUnicodeCacheSize);
unicodeToUnicodeCache =
@ -3168,7 +3169,14 @@ GBool GlobalParams::getDrawContent() {
return draw;
}
int GlobalParams::getDrawFormField() {
int formField;
lockGlobalParams;
formField = drawFormField;
unlockGlobalParams;
return formField;
}
GString *GlobalParams::getPaperColor() {
GString *s;
@ -3732,6 +3740,12 @@ void GlobalParams::setDrawContent(GBool draw) {
unlockGlobalParams;
}
void GlobalParams::setDrawFormField(int formField) {
lockGlobalParams;
drawFormField = formField;
unlockGlobalParams;
}
void GlobalParams::setOverprintPreview(GBool preview) {
lockGlobalParams;
overprintPreview = preview;

View File

@ -326,6 +326,7 @@ public:
GBool getDrawAnnotations();
GBool getDrawFormFields();
GBool getDrawContent();
int getDrawFormField();
GBool getOverprintPreview() { return overprintPreview; }
GString *getPaperColor();
GString *getMatteColor();
@ -395,6 +396,7 @@ public:
void setDrawAnnotations(GBool draw);
void setDrawFormFields(GBool draw);
void setDrawContent(GBool draw);
void setDrawFormField(int formField);
void setOverprintPreview(GBool preview);
void setMapNumericCharNames(GBool map);
void setMapUnknownCharNames(GBool map);
@ -594,6 +596,7 @@ private:
GBool printCommands; // print the drawing commands
GBool errQuiet; // suppress error messages?
GString *debugLogFile; // path for debug log file
int drawFormField;
CharCodeToUnicodeCache *cidToUnicodeCache;
CharCodeToUnicodeCache *unicodeToUnicodeCache;