Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

too many commas in my comma delimited list

Explorer ,
Oct 28, 2010 Oct 28, 2010

I'm trying to merge several pdf files into one by using the cfpdf tag (action="merge").  In the source attribute, you can enter a comma delimited list of file paths to merge the pdf files together.  I'm thinking that Adobe could have picked a better delimiter though because it breaks if there is a comma any one of the file names.  I've tried using replace() to replace the commas in my filenames with chr(44) before passing it to the cfpdf tag, but it still breaks.  Any ideas on how to accommodate this?  I'm trying to prevent having to copy hundreds of files to a temp directory, then use the directory attribute instead, then delete the temp directory.  That just seems like such a waste of resources...

Thanks!

1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Oct 28, 2010 Oct 28, 2010

Use the cfpdfparam tag and list them manually perhaps.  Or fix the data and files with somethign that is bound to cause issues again and again (regardless if it is technically ok).

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-763e.html

Translate
Contributor ,
Oct 28, 2010 Oct 28, 2010

If you can, it may be worth writing a quick regex to remove all the commas

from file names that get selected for this process. Once you know the file

names, just use CFFILE to rename any that have a comma, then rebuild the

list of file names from the list of changes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 28, 2010 Oct 28, 2010

Although that would work, it's not very practical in my case.  I would also have to change

the name of the file(s) in the database and would also have to write something to prevent the file name change from overwriting another version of the file (in case one happened to be the exact same but didn't have any commas).  It would also cause problems for new versions of the documents because when the architect uploads their new versions, they're typically named exactly the same and thats how we manage our version control.  I find it hard to believe that Adobe used a comma to seperate the list instead of one of many other delimiters that are not valid within filenames.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 28, 2010 Oct 28, 2010

Use the cfpdfparam tag and list them manually perhaps.  Or fix the data and files with somethign that is bound to cause issues again and again (regardless if it is technically ok).

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-763e.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Oct 28, 2010 Oct 28, 2010

You might also try using DDX (same concept)

http://livedocs.adobe.com/coldfusion/8/cfpdf_17.html

But I agree that comma "," is a poor choice here. There should be an option to supply an alternate delimiter. Consider submitting an enhancement request

http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html

-Leigh

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 28, 2010 Oct 28, 2010

cfpdfparam is a WIN!  Thanks for the heads up, i had no idea that you could use the tag like that.

<cfpdf

action = "merge"

destination = "C:\Inetpub\mydir\secure\test\output_merge.pdf"

overwrite = "yes">

<cfpdfparam source = "C:\Inetpub\mydir\secure\test\0003. A-001 - Restaurant, Floor Plan.pdf">

<cfpdfparam source = "#expandPath('/secure/test/0001. G-001 - General.pdf')#">

<cfpdfparam source = "#expandPath('/secure/test/0002. G-101 - General Information.pdf')#">

</cfpdf>

Works Great, Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 28, 2010 Oct 28, 2010
LATEST

Oh, nice, that is really handy to know.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources