33 int main(
int argc,
char **argv)
38 if (!strcmp(argv[k],
"-f"))
42 for (
int j = k; j < argc; ++j)
45 else if (!strcmp(argv[k],
"-o"))
49 for (
int j = k; j < argc; ++j)
53 else if (!strcmp(argv[k],
"-opw"))
57 for (
int j = k; j < argc; ++j)
60 else if (!strcmp(argv[k],
"-upw"))
64 for (
int j = k; j < argc; ++j)
71 #if POPPLER_CHECK_VERSION(0, 83, 0)
72 globalParams = std::make_unique<GlobalParams>();
74 globalParams =
new GlobalParams();
76 globalParams->setErrQuiet(
true);
78 globalParams->setupBaseFonts(
nullptr);
84 if( ! fgets( aPwBuf,
sizeof(aPwBuf)-1, stdin ) )
88 for(
size_t i = 0;
i <
sizeof(aPwBuf);
i++ )
90 if( aPwBuf[
i] ==
'\n' )
99 GooString* pFileName =
new GooString(argv[1]);
100 GooString* pErrFileName =
new GooString(argv[2]);
103 GooString* pOwnerPasswordStr( aPwBuf[0] != 0
104 ?
new GooString( aPwBuf )
108 GooString* pUserPasswordStr( aPwBuf[0] != 0
109 ?
new GooString( aPwBuf )
122 PDFDoc aDoc( pFileName,
126 PDFDoc aErrDoc( pErrFileName,
131 PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
134 if (!strcmp(
options,
"SkipImages")) {
139 const int nPages = rDoc.isOk()? rDoc.getNumPages(): 0;
146 for (
int i = 1;
i <= nPages; ++
i)
148 rDoc.displayPage(&aOutDev,
150 PDFI_OUTDEV_RESOLUTION,
151 PDFI_OUTDEV_RESOLUTION,
152 0,
true,
true,
true);
153 rDoc.processLinks(&aOutDev,
i);
#define PDFI_OUTDEV_RESOLUTION
static const char * ownerPassword
static const char * userPassword
int main(int argc, char **argv)
static void setPageNum(int nNumPages)
void setSkipImages(bool bSkipImages)
static const char * outputFile
static const char * options