2

I am trying to scale a cfdocument item using the scale attribute but it doesn't seem to use the number passed. The end goal is to get this cfdocument to scale to a single page when exported to pdf.

I tried using the method shown here: scale PDF to single page It just kept looping until the scale value was negative and that threw an error.

I haven't been able to find anything online and am expecting that the scale attribute doesn't work with tables or something like that.

<cfdocument localUrl="no" format="PDF" scale="10" fontembed="false">
    <cfoutput>
    <body>
        <cfdocumentitem type="header"> 
            <img id="logo" style="display:inline-block;float:left;margin-bottom:5px;" src="/images/logo206x40.jpg">
            <div style="font-size:20px;display:inline-block;float:right;">&nbsp;&nbsp;Rubric: #qryRubric.rubric_name#</div>
            <div style="width:100%;border-bottom:1px solid black;"></div>
        </cfdocumentitem>

        <div id="rubric1">
            <div style="margin-left: 10%;">
                <table class=" table table-hover blue-rubric table-bordered" cellspacing="1">
                    <thead>
                        <tr>
                            <th style="border-right:1px solid #fff"></th>
                            <th colspan="1000">Achievement Levels</th>
                        </tr>
                    <tr>

                        <th scope="col" class="rounded-firstcol" style="border-right:1px solid #fff;">Criteria Groups</th>
                        <th scope="col">1</th>
                        <th scope="col">2</th>
                        <th scope="col">3</th>
                        <th scope="col" class="rounded-lastcol">4</th>
                    </tr>
                    </thead>
                    <tbody>
                            <tr class="col_A">
                                <td>something</td>
                                <td>something</td>
                                <td>something</td>
                                <td>something</td>
                                <td>something</td>
                            </tr>
                            <tr class="col_A">
                                <td>something</td>
                                <td>something</td>
                                <td>something</td>
                                <td>something</td>
                                <td>something</td>
                            </tr>
                    </tbody>
                    <tfoot>
                        <tr></tr>
                    </tfoot>
                </table>
            </div>
        </div>
        <cfdocumentitem type="footer"> 
            <div style="width:100%;border-top:1px solid black;font-size:10px;font:Arial;text-align:right;"> #cfdocument.currentpagenumber# of #cfdocument.totalpagecount#</div>
        </cfdocumentitem>
    </body>
</cfoutput>

I read somewhere that scale changes the size of thumbnails relative to the document or something like that, can anyone confirm or deny this? Any help would be appreciated, thanks.

Community
  • 1
  • 1
Trug
  • 322
  • 2
  • 14

1 Answers1

0

I haven't used that attribute in quite some time, but if memory serves, I believe that value should be a percentage. For example scale="10%".

Javamav
  • 153
  • 2
  • 6
  • According to the documentation (Coldfusion 9 but close enough) the value must be a number less than 100. If I try to put a percentage in the value i get a `can't cast string to a number value` error. http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7c21.html – Trug Feb 09 '16 at 14:35