to cfloop or not to cfloop?

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default to cfloop or not to cfloop?

    :confused;
    I have a list of checkboxes from a form, and a submit button for "Batch Print"
    The var is "SelectList" and comes out as comma dilimited. I need to loop over
    each value, and insert it as another "page" in my CFX_PDF tag.

    What I am trying to do: I have a list of PDF files and would like a batch
    print functions. Checkbox for each PDF and a Batch Print submit bitton. CF
    takes these record ID's of the PDFs and loops over them. Creating a new PDF
    with each page being one of the selected PDFs. Basicall transforming all the
    selected PDF's into one big PDF with multiple pages. I am able to read
    existing PDF's and create pages using CFX_PDF, but not sure how to get the code
    to loop over the selected values, read the filenames (DB column) for these ID's
    and insert the filenames into the new PDF. I have an example of how to read a
    PDF and count the number of pages in it, so I just need to modify it to read
    separate one page pdf and insert them into the new one.

    See code. Thanks for your help.



    <cfcase value="batch">
    <cfset SelectList = form.selectlist>
    <!---Select list is something like: 17,21,34--->
    <cfquery datasource="prereg">
    UPDATE pdf_status
    SET print_flag = 'Yes'
    WHERE ID IN (0#SelectList#)
    </cfquery>
    <cfset status = "Printed">
    <!---Need to count how many total are in SelectList--->
    <cfset index=#SelectList#>
    <cfloop query="request.PDFInfo">
    <!---loop over SelectList values-->
    <cf_pdf_page width="#width#" height="#height#">
    <cf_pdf_read file="#pdf_filename#" page="#index#" />
    <!---Read each value and insert as a new page--->
    </cf_pdf_page>
    <cfset index = index + 1>
    </cfloop>

    chriskeeler2 Guest

  2. Similar Questions and Discussions

    1. cfloop
      The goal is to insert a record into table 'atd', which contains a document id and an associate id, for each document (38) and associate (150). So...
    2. cfloop error
      I am getting an error that is resolving to the closing tag for the </cfloop>. Any Ideas? <cfoutput query="Recordset1" group="category"> <table...
    3. Cfloop..
      I am trying to loop over a list: <cfquery name="updsyllabus" datasource="#arguments.syl.dsn#"> UPDATE #arguments.syl.tname# SET <cfloop...
    4. <cfloop> question
      The code below generates a list of form fields for my form. I've been asked to see if it's possible to skip a line after every two form fields. Is...
    5. CFLOOP/CURRENTROW
      I have a LOOP that runs over a query and I use CURRENTROW so that I can then use MOD on it so I can utilize repeating ARRAY data to change the color...
  3. #2

    Default Re: to cfloop or not to cfloop?

    Are you using CF7? If so you could use the cfdocument tag to output to PDF. you
    could have all of the pdfs on a page, each wrapped in a isDefined() or cfif
    statment. and use the pagebreak in between each PDF link. then. when some radio
    buttons are submitted it would print all of the selected pdfs. Sort of chaining
    (batching) them together breaking after each document. Hope this helps.

    GeorgeWS Guest

  4. #3

    Default Re: to cfloop or not to cfloop?

    No. CFMX 6.1 with the CFX tag called CFX_PDF
    chriskeeler2 Guest

  5. #4

    Default Re: to cfloop or not to cfloop?

    See next post...the saga continues
    chriskeeler2 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139