-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpdfutil.cpp
More file actions
37 lines (32 loc) · 809 Bytes
/
Copy pathpdfutil.cpp
File metadata and controls
37 lines (32 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "galapdf.h"
#include "pdfutil.h"
xpdf_rc::xpdf_rc(char* text_enc_name /*=NULL*/)
{
globalParams = new GlobalParams(cfg_file);
if (text_enc_name && text_enc_name[0])
globalParams->setTextEncoding(text_enc_name);
umap = globalParams->getTextEncoding();
}
xpdf_rc::~xpdf_rc()
{
if (umap)
umap->decRefCnt();
delete globalParams;
}
xpdf_doc::xpdf_doc(char* filename, char* owner_password, char* user_password)
{
GString* file_name = new GString(filename);
GString* owner_pwd = owner_password[0] != '\001' ?
new GString(owner_password) :
NULL;
GString* user_pwd = user_password[0] != '\001' ?
new GString(user_password) :
NULL;
doc = new PDFDoc(file_name, owner_pwd, user_pwd);
delete owner_pwd;
delete user_pwd;
}
xpdf_doc::~xpdf_doc()
{
delete doc;
}