|
Lines 111-117
static ZoomMenuInfo zoomMenuInfo[nZoomMe
|
Link Here
|
|---|
|
//------------------------------------------------------------------------ | //------------------------------------------------------------------------ |
| |
XPDFViewer::XPDFViewer(XPDFApp *appA, GooString *fileName, | XPDFViewer::XPDFViewer(XPDFApp *appA, GooString *fileName, |
int pageA, UGooString *destName, |
int pageA, GooString *destName, |
GooString *ownerPassword, GooString *userPassword) { | GooString *ownerPassword, GooString *userPassword) { |
LinkDest *dest; | LinkDest *dest; |
int pg; | int pg; |
|
Lines 185-191
XPDFViewer::~XPDFViewer() {
|
Link Here
|
|---|
|
#endif | #endif |
} | } |
| |
void XPDFViewer::open(GooString *fileName, int pageA, UGooString *destName) { |
void XPDFViewer::open(GooString *fileName, int pageA, GooString *destName) { |
LinkDest *dest; | LinkDest *dest; |
int pg; | int pg; |
double z; | double z; |
|
Lines 267-273
void XPDFViewer::displayDest(LinkDest *d
|
Link Here
|
|---|
|
core->displayDest(dest, zoomA, rotateA, addToHist); | core->displayDest(dest, zoomA, rotateA, addToHist); |
} | } |
| |
void XPDFViewer::getPageAndDest(int pageA, UGooString *destName, |
void XPDFViewer::getPageAndDest(int pageA, GooString *destName, |
int *pageOut, LinkDest **destOut) { | int *pageOut, LinkDest **destOut) { |
Ref pageRef; | Ref pageRef; |
| |
|
Lines 2299-2314
void XPDFViewer::initPrintDialog() {
|
Link Here
|
|---|
|
XtSetArg(args[n], XmNcancelButton, cancelBtn); ++n; | XtSetArg(args[n], XmNcancelButton, cancelBtn); ++n; |
XtSetValues(printDialog, args, n); | XtSetValues(printDialog, args, n); |
| |
//----- initial values |
|
if ((psFileName = globalParams->getPSFile())) { |
|
if (psFileName->getChar(0) == '|') { |
|
XmTextFieldSetString(printCmdText, |
|
psFileName->getCString() + 1); |
|
} else { |
|
XmTextFieldSetString(printFileText, psFileName->getCString()); |
|
} |
|
delete psFileName; |
|
} |
|
} | } |
| |
void XPDFViewer::setupPrintDialog() { | void XPDFViewer::setupPrintDialog() { |
|
Lines 2318-2351
void XPDFViewer::setupPrintDialog() {
|
Link Here
|
|---|
|
char *p; | char *p; |
| |
doc = core->getDoc(); | doc = core->getDoc(); |
psFileName = globalParams->getPSFile(); |
|
if (!psFileName || psFileName->getChar(0) == '|') { |
|
pdfFileName = doc->getFileName(); |
|
p = pdfFileName->getCString() + pdfFileName->getLength() - 4; |
|
if (!strcmp(p, ".pdf") || !strcmp(p, ".PDF")) { |
|
psFileName2 = new GooString(pdfFileName->getCString(), |
|
pdfFileName->getLength() - 4); |
|
} else { |
|
psFileName2 = pdfFileName->copy(); |
|
} |
|
psFileName2->append(".ps"); |
|
XmTextFieldSetString(printFileText, psFileName2->getCString()); |
|
delete psFileName2; |
|
} |
|
if (psFileName && psFileName->getChar(0) == '|') { |
|
XmToggleButtonSetState(printWithCmdBtn, True, False); |
|
XmToggleButtonSetState(printToFileBtn, False, False); |
|
XtVaSetValues(printCmdText, XmNsensitive, True, NULL); |
|
XtVaSetValues(printFileText, XmNsensitive, False, NULL); |
|
} else { |
|
XmToggleButtonSetState(printWithCmdBtn, False, False); | XmToggleButtonSetState(printWithCmdBtn, False, False); |
XmToggleButtonSetState(printToFileBtn, True, False); | XmToggleButtonSetState(printToFileBtn, True, False); |
XtVaSetValues(printCmdText, XmNsensitive, False, NULL); | XtVaSetValues(printCmdText, XmNsensitive, False, NULL); |
XtVaSetValues(printFileText, XmNsensitive, True, NULL); | XtVaSetValues(printFileText, XmNsensitive, True, NULL); |
} |
|
if (psFileName) { |
|
delete psFileName; |
|
} |
|
| |
sprintf(buf, "%d", doc->getNumPages()); | sprintf(buf, "%d", doc->getNumPages()); |
XmTextFieldSetString(printFirstPage, "1"); | XmTextFieldSetString(printFirstPage, "1"); |
|
Lines 2419-2429
void XPDFViewer::printPrintCbk(Widget wi
|
Link Here
|
|---|
|
} | } |
| |
psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(), | psOut = new PSOutputDev(psFileName->getCString(), doc->getXRef(), |
doc->getCatalog(), firstPage, lastPage, |
doc->getCatalog(), NULL, firstPage, lastPage, |
psModePS); |
psModePS, 0, 0, gFalse, 0, 0, 0, 0, gFalse, gFalse); |
if (psOut->isOk()) { | if (psOut->isOk()) { |
doc->displayPages(psOut, firstPage, lastPage, 72, 72, | doc->displayPages(psOut, firstPage, lastPage, 72, 72, |
0, gTrue, globalParams->getPSCrop(), gFalse); |
0, gTrue, gFalse, gFalse); |
} | } |
delete psOut; | delete psOut; |
delete psFileName; | delete psFileName; |