Status/Resolution/Reason: To Fix//Investigate
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 03/10/2016
Components: Document Management
Versions: 2016
Failure Type: Enhancement Request
Found In Build/Fixed In Build: Alpha_v12 /
Priority/Frequency: Major / Unknown
Locale/System: English / Win All
Vote Count: 0
Related ticket 4060772 is for Pre-CF12. This ticket here is b/c I couldn't file this ticket in the public tracker b/c the information below is NDA.
cfpdf/cfpdfparam/cfpdfform have near-complete VFS support. This ER is to complete the VFS support for these, for the cfpdf actions added in Raijin, which will then complete CF's VFS support.
Steps to reproduce:
1) Download attached CFDocumentWithComment.pdf and CFHTMLToPDFWithComment.pdf
2) Create the "temp" and "result" subfolders
3) Run the following and see errors are thrown as described in each example
Actual result: each throws an error
Expected result: none should thrown an error
<!--- setup --->
<cfscript>
  //resets the temporary directories
  function resetTemp() {
	  if(directoryExists(expandPath("./temp"))) {
		  directoryDelete(expandPath("./temp"), true);
	  }
	  directoryCreate(expandPath("./temp"));
	  if(directoryExists("ram://temp")) {
		  directoryDelete("ram://temp", true);
	  }
	  directoryCreate("ram://temp");
  }
  //resets the result directory
  function resetResult() {
	  if(directoryExists(expandPath("./result"))) {
		  directoryDelete(expandPath("./result"), true);
	  }
	  directoryCreate(expandPath("./result"));
  }
  //generates a cfdocument comment file and a cfhtmltopdf comment file
  function generateCommentFiles() {
	  cfpdf(action="export", type="comment", source=expandPath('./CFDocumentWithComment.pdf'), exportto=expandPath('./MyCommentCFDocument.xfdf'), overwrite=true);
	  cfpdf(action="export", type="comment", source=expandPath('./CFHTMLToPDFWithComment.pdf'), exportto=expandPath('./MyCommentCFHTMLToPDF.xfdf'), overwrite=true);
  }
  //generates a cfdocument metadata file and a cfhtmltopdf metadata file
  function generateMetadataFiles() {
	  cfdocument(format="pdf", filename=expandPath('./temp/MyPDFTempCFDocument.pdf'), overwrite="true") {writeOutput("my temporary cfdocument PDF");};
	  cfpdf(action="export", type="metadata", source=expandPath('./temp/MyPDFTempCFDocument.pdf'), exportto=expandPath('./MyMetadataCFDocument.xmp'), overwrite=true);
	  cfhtmltopdf(destination=expandPath('./temp/MyPDFTempCFHTMLToPDF.pdf'), overwrite="true") {writeOutput("my temporary cfhtmltopdf PDF");};
	  cfpdf(action="export", type="metadata", source=expandPath('./temp/MyPDFTempCFHTMLToPDF.pdf'), exportto=expandPath('./MyMetadataCFHTMLToPDF.xmp'), overwrite=true);
  }
  
  generateCommentFiles();
  generateMetadataFiles();
  resetTemp();
  resetResult();
</cfscript>
<!--- action="sanitize" --->
<cfscript>
  theHTML = '<img src="http://wwwimages.adobe.com/content/dam/Adobe/images/shared/product-totems/80x80/totem-coldfusion-11-80x80.png.adimg.mw.80.png">';
  
  try {
	  cfdocument(format="pdf", filename="ram://temp/myPDF.pdf", overwrite=true) {writeOutput(theHTML);};
	  cfpdf(action="sanitize", source="ram://temp/myPDF.pdf");//throws: coldfusion.pdf.PDFDocOperation$PDFOperationException: An error occurred during SANITIZE operation in the cfpdf tag.
	  writeOutput("YES");
  }
  catch(any e) {writeOutput("NO");}
  
  resetTemp();
  
  try {
	  cfhtmltopdf(destination="ram://temp/myPDF.pdf", overwrite=true) {writeOutput(theHTML);};
	  cfpdf(action="sanitize", source="ram://temp/myPDF.pdf");//throws: coldfusion.pdf.PDFDocOperation$PDFOperationException: An error occurred during SANITIZE operation in the cfpdf tag.
	  writeOutput("YES");
  }
  catch(any e) {writeOutput("NO");}
  
  resetTemp();
</cfscript>
<!--- action="export" type="comment" --->
<cfscript>
  cfpdf(action="write", source=expandPath('./CFDocumentWithComment.pdf'), destination="ram://temp/MyPDF.pdf", overwrite=true);
  cfpdf(action="export", type="comment", source="ram://temp/MyPDF.pdf", exportto="ram://temp/MyMetadata05.xfdf", overwrite="true");//throws suppressed exception: java.io.FileNotFoundException: ram:///temp/MyPDF.pdf (The filename, directory name, or volume label syntax is incorrect)
  writeOutput(fileExists("ram://temp/MyMetadata05.xfdf"));//returns NO (bad)
  
  resetTemp();
  
  cfpdf(action="write", source=expandPath('./CFHTMLToPDFWithComment.pdf'), destination="ram://temp/MyPDF.pdf", overwrite=true);
  cfpdf(action="export", type="comment", source="ram://temp/MyPDF.pdf", exportto="ram://temp/MyMetadata06.xfdf", overwrite="true");//throws suppressed exception: java.io.FileNotFoundException: ram:///temp/MyPDF.pdf (The filename, directory name, or volume label syntax is incorrect)
  writeOutput(fileExists("ram://temp/MyMetadata06.xfdf"));//returns NO (bad)
  
  resetTemp();
</cfscript>
<!--- action="import" type="comment" --->
<cfscript>
  cfdocument(format="pdf", filename="ram://temp/myPDF.pdf") {writeOutput("my PDF");};
  fileWrite("ram://temp/MyCommentCFDocument.xfdf", fileRead(expandPath('./MyCommentCFDocument.xfdf')));
  try {
	  cfpdf(action="import", type="comment", source="ram://temp/myPDF.pdf", importfrom="ram://temp/MyCommentCFDocument.xfdf", destination=expandPath('./temp/MyPDF.pdf'), overwrite="true");//throws: java.io.FileNotFoundException: ram:///temp/myPDF.pdf (The filename, directory name, or volume label syntax is incorrect)
	  cfpdf(action="export", type="comment", source=expandPath('./temp/MyPDF.pdf'), exportto=expandPath('./result/MyComment09.xfdf'), overwrite=true);
  }
  catch(any e) {}
  writeOutput(fileExists(expandPath('./result/MyComment09.xfdf')));
  
  resetTemp();
  
  cfhtmltopdf(destination="ram://temp/myPDF.pdf") {writeOutput("my PDF");};
  fileWrite("ram://temp/MyCommentCFHTMLToPDF.xfdf", fileRead(expandPath('./MyCommentCFHTMLToPDF.xfdf')));
  try {
	  cfpdf(action="import", type="comment", source="ram://temp/myPDF.pdf", importfrom="ram://temp/MyCommentCFHTMLToPDF.xfdf", destination=expandPath('./temp/MyPDF.pdf'), overwrite="true");//java.io.FileNotFoundException: ram:///temp/myPDF.pdf (The filename, directory name, or volume label syntax is incorrect)
	  cfpdf(action="export", type="comment", source=expandPath('./temp/MyPDF.pdf'), exportto=expandPath('./result/MyComment10.xfdf'), overwrite=true);
  }
  catch(any e) {}
  writeOutput(fileExists(expandPath('./result/MyComment10.xfdf')));
  
  resetTemp();
</cfscript>
<!--- action="export" type="metadata" --->
<cfscript>
  //export metadata from cfdocument ram://
  cfdocument(format="pdf", filename="ram://temp/MyPDF.pdf", overwrite="true") {writeOutput("my PDF");};
  cfpdf(action="export", type="metadata", source="ram://temp/MyPDF.pdf", exportto="ram://temp/MyMetadata05.xmp", overwrite="true");//throws suppressed exception: java.io.FileNotFoundException: ram:///temp/MyPDF.pdf (The filename, directory name, or volume label syntax is incorrect)
  writeOutput(fileExists("ram://temp/MyMetadata05.xmp"));//returns NO (bad)
  
  resetTemp();
  
  //export metadata from cfhtmltopdf ram://
  cfhtmltopdf(destination="ram://temp/MyPDF.pdf", overwrite="true") {writeOutput("my PDF");};
  cfpdf(action="export", type="metadata", source="ram://temp/MyPDF.pdf", exportto="ram://temp/MyMetadata06.xmp", overwrite="true");//throws suppressed exception: java.io.FileNotFoundException: ram:///temp/MyPDF.pdf (The filename, directory name, or volume label syntax is incorrect)
  writeOutput(fileExists("ram://temp/MyMetadata06.xmp"));//returns NO (bad)
  
  resetTemp();
</cfscript>
<!--- action="import" type="metadata" --->
<cfscript>
  cfdocument(format="pdf", filename="ram://temp/myPDF.pdf") {writeOutput("my PDF");};
  fileWrite("ram://temp/MyMetadataCFDocument.xmp", fileRead(expandPath('./MyMetadataCFDocument.xmp')));
  try {
	  cfpdf(action="import", type="metadata", source="ram://temp/myPDF.pdf", importfrom="ram://temp/MyMetadataCFDocument.xmp", destination=expandPath('./temp/MyPDF.pdf'), overwrite="true");//throws: java.io.FileNotFoundException: ram:///temp/myPDF.pdf (The filename, directory name, or volume label syntax is incorrect)
	  cfpdf(action="export", type="metadata", source=expandPath('./temp/MyPDF.pdf'), exportto=expandPath('./result/MyMetadata09.xmp'), overwrite=true);
  }
  catch(any e) {}
  writeOutput(fileExists(expandPath('./result/MyMetadata09.xmp')));
  
  resetTemp();
  
  //try cfhtmltopdf ram:// as import source
  cfhtmltopdf(destination="ram://temp/myPDF.pdf") {writeOutput("my PDF");};
  fileWrite("ram://temp/MyMetadataCFHTMLToPDF.xmp", fileRead(expandPath('./MyMetadataCFHTMLToPDF.xmp')));
  try {
	  cfpdf(action="import", type="metadata", source="ram://temp/myPDF.pdf", importfrom="ram://temp/MyMetadataCFHTMLToPDF.xmp", destination=expandPath('./temp/MyPDF.pdf'), overwrite="true");//throws: java.io.FileNotFoundException: ram:///temp/myPDF.pdf (The filename, directory name, or volume label syntax is incorrect)
	  cfpdf(action="export", type="metadata", source=expandPath('./temp/MyPDF.pdf'), exportto=expandPath('./result/MyMetadata10.xmp'), overwrite=true);
  }
  catch(any e) {}
  writeOutput(fileExists(expandPath('./result/MyMetadata10.xmp')));
  
  resetTemp();
</cfscript>
<!--- action="archive" --->
<cfscript>
  try {
	  cfdocument(format="pdf", filename="ram://temp/MyPDF.pdf", overwrite=true) {writeOutput("my PDF");}
	  cfpdf(action="archive", source="ram://temp/MyPDF.pdf");//throws: Error: java.io.FileNotFoundException: ram:\temp\MyPDF.pdf (The filename, directory name, or volume label syntax is incorrect)
	  writeOutput("YES");
  }
  catch(any e) {writeOutput("NO");};
  
  resetTemp();
  
  try {
	  cfhtmltopdf(destination="ram://temp/MyPDF.pdf", overwrite=true) {writeOutput("my PDF");}
	  cfpdf(action="archive", source="ram://temp/MyPDF.pdf");//throws: java.io.FileNotFoundException: ram:\temp\MyPDF.pdf (The filename, directory name, or volume label syntax is incorrect)
	  writeOutput("YES");
  }
  catch(any e) {writeOutput("NO");};
  
  resetTemp();
</cfscript>
<!--- action="addattachments" --->
<cfscript>
  try {
	  cfdocument(format="pdf", filename="ram://temp/myPDF.pdf") {writeOutput("my PDF");};
	  cfdocument(format="pdf", filename="ram://temp/myPDFAttachment.pdf") {writeOutput("my PDF attachment");};
	  cfpdf(action="addattachments", source="ram://temp/myPDF.pdf", destination=expandPath('./result/MyPDF07.pdf'), overwrite=true) {//throws: java.io.IOException: Null ByteReader parameter
		  cfpdfparam(source="ram://temp/myPDFAttachment.pdf", filename="MyPDFAttachment.pdf", encoding="UTF-8") {};
	  };
	  writeOutput(fileExists(expandPath('./result/MyPDF07.pdf')));
  }
  catch(any e) {writeOutput("NO");}
  
  resetTemp();
  
  try {
	  cfhtmltopdf(destination="ram://temp/myPDF.pdf") {writeOutput("my PDF");};
	  cfhtmltopdf(destination="ram://temp/myPDFAttachment.pdf") {writeOutput("my PDF");};
	  cfpdf(action="addattachments", source="ram://temp/myPDF.pdf", destination=expandPath('./result/MyPDF08.pdf'), overwrite=true) {//throws: java.io.IOException: Null ByteReader parameter
		  cfpdfparam(source="ram://temp/myPDFAttachment.pdf", filename="MyPDFAttachment.pdf", encoding="UTF-8") {};
	  };
	  writeOutput(fileExists(expandPath('./result/MyPDF08.pdf')));
  }
  catch(any e) {writeOutput("NO");}
</cfscript>
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID:	4127100
External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email: adobelabs@itisdesign.comAttachments:
Comments: