cfpdf protect pdf permissions ignored
i have been trying protect pdf's have been creating new coldfusion 8 cfpdf tag.
step 1: create new pdf using cfpdf action="processddx" , ..
step 2: try , protect newly created pdf cfpdf action="protect" , only permission "allowprinting".
this works fine...
however - if run code again using "protected".pdf source document code still works though i'm assembling new pdf document don't have permission!
it breaks when gets line cfpdf action="protect" again (as doc password protected).
some code:
<cfsavecontent variable="myddx">
<?xml version="1.0" encoding="utf-8" ?>
<ddx xmlns=" http://ns.adobe.com/ddx/1.0/"
xmlns:xsi=" http://www.w3.org/2001/xmlschema-instance"
xsi:schemalocation=" http://ns.adobe.com/ddx/1.0/ coldfusion_ddx.xsd">
<pdf result="output1">
<pdf source="doc1">
<header replaceexisting="true">
<right>
<styledtext><p color="##333333" font="arial" font-size="9pt">personal report valid users name here</p></styledtext>
</right>
</header>
<footer replaceexisting="true">
<left>
<styledtext>
<p color="##333333" font="arial" font-size="7pt">valid user until valid date</p>
</styledtext>
</left>
<right>
<styledtext>
<p color="##333333" font="arial" font-size="7pt">page <_pagenumber/> of <_lastpagenumber/></p>
</styledtext>
</right>
</footer>
</pdf>
</pdf>
</ddx>
</cfsavecontent>
<cfif isddx(myddx)>
<!--- setup mapping source pdf files --->
<cfset sinput = structnew() />
<cfset sinput.doc1 = "original.pdf" />
<!--- setup mapping result pdf files --->
<cfset soutput = structnew() />
<cfset soutput.output1 = "protected.pdf" />
<!--- use cfpdf tag process ddx document --->
<cfpdf action="processddx"
ddxfile="#myddx#"
inputfiles="#sinput#"
outputfiles="#soutput#"
name="result"/>
<cfpdf action="protect"
source="protected.pdf"
newownerpassword="sampl3pa55w0rd"
permissions="allowprinting">
<!--- display success / failure result of operation --->
<cfoutput>#result.output1#</cfoutput>
<cfdump var="#result#">
<cfelse>
<p>the sample.ddx file not valid ddx xml document.</p>
</cfif>
any appreciated.
cheers
marty
step 1: create new pdf using cfpdf action="processddx" , ..
step 2: try , protect newly created pdf cfpdf action="protect" , only permission "allowprinting".
this works fine...
however - if run code again using "protected".pdf source document code still works though i'm assembling new pdf document don't have permission!
it breaks when gets line cfpdf action="protect" again (as doc password protected).
some code:
<cfsavecontent variable="myddx">
<?xml version="1.0" encoding="utf-8" ?>
<ddx xmlns=" http://ns.adobe.com/ddx/1.0/"
xmlns:xsi=" http://www.w3.org/2001/xmlschema-instance"
xsi:schemalocation=" http://ns.adobe.com/ddx/1.0/ coldfusion_ddx.xsd">
<pdf result="output1">
<pdf source="doc1">
<header replaceexisting="true">
<right>
<styledtext><p color="##333333" font="arial" font-size="9pt">personal report valid users name here</p></styledtext>
</right>
</header>
<footer replaceexisting="true">
<left>
<styledtext>
<p color="##333333" font="arial" font-size="7pt">valid user until valid date</p>
</styledtext>
</left>
<right>
<styledtext>
<p color="##333333" font="arial" font-size="7pt">page <_pagenumber/> of <_lastpagenumber/></p>
</styledtext>
</right>
</footer>
</pdf>
</pdf>
</ddx>
</cfsavecontent>
<cfif isddx(myddx)>
<!--- setup mapping source pdf files --->
<cfset sinput = structnew() />
<cfset sinput.doc1 = "original.pdf" />
<!--- setup mapping result pdf files --->
<cfset soutput = structnew() />
<cfset soutput.output1 = "protected.pdf" />
<!--- use cfpdf tag process ddx document --->
<cfpdf action="processddx"
ddxfile="#myddx#"
inputfiles="#sinput#"
outputfiles="#soutput#"
name="result"/>
<cfpdf action="protect"
source="protected.pdf"
newownerpassword="sampl3pa55w0rd"
permissions="allowprinting">
<!--- display success / failure result of operation --->
<cfoutput>#result.output1#</cfoutput>
<cfdump var="#result#">
<cfelse>
<p>the sample.ddx file not valid ddx xml document.</p>
</cfif>
any appreciated.
cheers
marty
martin4finewine wrote:
if run code again using "protected".pdf source document code still works though i'm assembling new pdf document don't have permission!
i not think pdf passwords , permissions work way thinking. owner password grants ability modify pdf permissions or passwords. believe looking user password, corresponds ddx's document open password.
livecycle documentation:
if openpassword element unspecified, document not password-protected @ user level , document can opened anyone.
http://livedocs.adobe.com/livecycle/es/sdkhelp/programmer/sdkhelp/ddxrefmain.163.66.html#1 551861
your file not have user password. may why can copy without error.
if run code again using "protected".pdf source document code still works though i'm assembling new pdf document don't have permission!
i not think pdf passwords , permissions work way thinking. owner password grants ability modify pdf permissions or passwords. believe looking user password, corresponds ddx's document open password.
livecycle documentation:
if openpassword element unspecified, document not password-protected @ user level , document can opened anyone.
http://livedocs.adobe.com/livecycle/es/sdkhelp/programmer/sdkhelp/ddxrefmain.163.66.html#1 551861
your file not have user password. may why can copy without error.
More discussions in ColdFusion
adobe
Comments
Post a Comment