GString *s1, *s2;
int i;
- if (infoDict->lookup(key, &obj)->isString()) {
+ if (infoDict && infoDict->lookup(key, &obj)->isString()) {
s1 = obj.getString();
if ((s1->getChar(0) & 0xff) == 0xfe &&
(s1->getChar(1) & 0xff) == 0xff) {
Object obj;
char *s;
- if (infoDict->lookup(key, &obj)->isString()) {
+ if (infoDict && infoDict->lookup(key, &obj)->isString()) {
s = obj.getString()->getCString();
if (s[0] == 'D' && s[1] == ':') {
s += 2;
GString *fileName = new GString(filename);
GString *userPW;
- // read config file
- if(!globalParams)
- globalParams = new GlobalParams("");
-
// open PDF file
if (userPassword && userPassword[0]) {
userPW = new GString(userPassword);
gfxsource_t*gfxsource_pdf_create()
{
+ if(!globalParams) {
+ globalParams = new GFXGlobalParams();
+ }
+
gfxsource_t*src = (gfxsource_t*)malloc(sizeof(gfxsource_t));
memset(src, 0, sizeof(gfxsource_t));
src->set_parameter = pdf_set_parameter;