git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dd130e1
)
moved the 'PDF disallows copying' to a lower level
author
kramm
<kramm>
Fri, 8 Feb 2008 10:42:08 +0000
(10:42 +0000)
committer
kramm
<kramm>
Fri, 8 Feb 2008 10:42:08 +0000
(10:42 +0000)
lib/pdf/pdf.cc
patch
|
blob
|
history
diff --git
a/lib/pdf/pdf.cc
b/lib/pdf/pdf.cc
index
7d13c7b
..
9390e4a
100644
(file)
--- a/
lib/pdf/pdf.cc
+++ b/
lib/pdf/pdf.cc
@@
-34,6
+34,7
@@
typedef struct _pdf_page_info
typedef struct _pdf_doc_internal
{
int protect;
typedef struct _pdf_doc_internal
{
int protect;
+ int nocopy;
PDFDoc*doc;
Object docinfo;
InfoOutputDev*info;
PDFDoc*doc;
Object docinfo;
InfoOutputDev*info;
@@
-187,6
+188,10
@@
gfxpage_t* pdf_doc_getpage(gfxdocument_t*doc, int page)
if(page < 1 || page > doc->num_pages)
return 0;
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));
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));
@@
-387,8
+392,7
@@
static gfxdocument_t*pdf_open(gfxsource_t*src, const char*filename)
i->protect = 0;
if (i->doc->isEncrypted()) {
if(!i->doc->okToCopy()) {
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;
}
if(!i->doc->okToChange() || !i->doc->okToAddNotes())
i->protect = 1;