typedef struct _pdf_doc_internal
{
int protect;
+ int nocopy;
PDFDoc*doc;
Object docinfo;
InfoOutputDev*info;
pi->middev->setparameter(pi->middev, "protect", "1");
dev = pi->middev;
}
- dev->setparameter(dev, "protect", "1");
if(!pi) {
msg("<fatal> pdf_page_render: Parent PDF this page belongs to doesn't exist yet/anymore");
if(page < 1 || page > doc->num_pages)
return 0;
+ if(di->nocopy) {
+ msg("<error> PDF disallows copying.");
+ return 0;
+ }
gfxpage_t* pdf_page = (gfxpage_t*)malloc(sizeof(gfxpage_t));
pdf_page_internal_t*pi= (pdf_page_internal_t*)malloc(sizeof(pdf_page_internal_t));
sprintf(buf, "%f", (double)ppm_dpi/(double)zoom);
storeDeviceParameter("ppmsubpixels", buf);
} else if(!strcmp(name, "poly2bitmap")) {
- i->config_bitmap_optimizing = 1;
+ i->config_bitmap_optimizing = atoi(value);
} else if(!strcmp(name, "multiply")) {
multiply = atoi(value);
} else if(!strcmp(name, "help")) {
i->protect = 0;
if (i->doc->isEncrypted()) {
if(!i->doc->okToCopy()) {
- printf("PDF disallows copying.\n");
- return 0;
+ i->nocopy = 1;
}
if(!i->doc->okToChange() || !i->doc->okToAddNotes())
i->protect = 1;