Coldfusion 80标签模板

时间:2015-10-02 16:08:24

标签: html css coldfusion

我正在尝试创建标签模板来打印标签。我正在使用coldfusion,当用户点击一个按钮时,它会提示他们想要从哪个数字开始,它会打印从该数字开始的标签,并循环80次,因为工作表上有多少标签。我正在尝试设置generate_labels.cfm并且无法使标签正确匹配。

现在,只需尝试以正确的布局和格式显示所有80个标签,并且我正在努力奋斗。

我一直在按照http://www.bennadel.com/blog/922-ask-ben-printing-shipping-labels-with-coldfusion.htm和此模板http://www.avery.com/avery/en_us/Templates-%26-Software/Templates/Labels/Return-Address-Labels/Return-Address-Label-80-per-sheet_Microsoft-Word.htm

逐步完成此操作

(假设空格为4,空格为20行。共80个标签)

这就是我想出的:enter image description here

MIME-Version: 1.0
            Content-Location: file:///C:/1E42A1F3/DealerLabels.htm
            Content-Transfer-Encoding: quoted-printable
            Content-Type: text/html; charset="us-ascii"

        <html
            xmlns:o=3D"urn:schemas-microsoft-com:office:office"
            xmlns:w=3D"urn:schemas-microsoft-com:office:word"
            xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
            xmlns=3D"http://www.w3.org/TR/REC-html40">

        <head>
            <meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
            <meta name=3DProgId content=3DWord.Document>
            <meta name=3DGenerator content=3D"Microsoft Word 14">
            <meta name=3DOriginator content=3D"Microsoft Word 14">
            <link rel=3DFile-List href=3D"DealerLabels_files/filelist.xml">


            <style>
            @font-face
                {font-family:Calibri;
                panose-1:2 15 5 2 2 2 4 3 2 4;
                mso-font-charset:0;
                mso-generic-font-family:swiss;
                mso-font-pitch:variable;
                mso-font-signature:-536870145 1073786111 1 0 415 0;}

            p.MsoNormal, li.MsoNormal, div.MsoNormal
                {mso-style-unhide:no;
                mso-style-qformat:yes;
                mso-style-parent:"";
                margin-top:0in;
                margin-right:0in;
                margin-bottom:10.0pt;
                margin-left:0in;
                line-height:115%;
                mso-pagination:widow-orphan;
                font-size:11.0pt;
                font-family:"Calibri","sans-serif";
                mso-fareast-font-family:"Times New Roman";
                mso-bidi-font-family:"Times New Roman";}
            p.AveryStyle1, li.AveryStyle1, div.AveryStyle1
                {mso-style-name:"Avery Style 1";
                mso-style-priority:99;
                mso-style-unhide:no;
                mso-style-parent:"";
                margin-top:1.45pt;
                margin-right:1.4pt;
                margin-bottom:1.45pt;
                margin-left:1.4pt;
                text-align:center;
                mso-pagination:widow-orphan;
                font-size:8.0pt;
                mso-bidi-font-size:11.0pt;
                font-family:"Arial","sans-serif";
                mso-fareast-font-family:"Times New Roman";
                color:black;
                mso-bidi-font-weight:bold;}
            @page WordSection1
                {size:8.5in 11.0in;
                margin:.5in 22.3pt 30.0pt 27.85pt;
                mso-header-margin:0in;
                mso-footer-margin:0in;
                mso-paper-source:0;}
            div.WordSection1
                {page:WordSection1;}

            table.MsoNormalTable
                {mso-style-name:"Table Normal";
                mso-tstyle-rowband-size:0;
                mso-tstyle-colband-size:0;
                mso-style-noshow:yes;
                mso-style-priority:99;
                mso-style-qformat:yes;
                mso-style-parent:"";
                mso-padding-alt:0in 5.4pt 0in 5.4pt;
                mso-para-margin:0in;
                mso-para-margin-bottom:.0001pt;
                mso-pagination:widow-orphan;
                font-size:10.0pt;
                font-family:"Calibri","sans-serif";}
            </style>
        </head>
        <body lang=3DEN-US style=3D'tab-interval:.5in'>


            <div class=3DWordSection1>


                <table 
                    class=3DMsoNormalTable 
                    border=3D0 
                    cellspacing=3D0 
                    cellpadding=3D0
                    style=3D'border-collapse:collapse;mso-table-layout-alt:fixed;mso-padding-alt:0in 5.75pt 0in 5.75pt'>


                    <tr style=3D'mso-yfti-irow:0;mso-yfti-firstrow:yes;height:.5in;mso-height-rule:exactly'>
                    <cfoutput> 


                         <!--- 
                             Instead of looping over a query as we probably 
                             would want to do, we are going to loop over an 
                             index array and just repeat the same address 
                             over and over again; we are just demonstrating 
                             label printing with ColdFusion and MS Word - 
                             we don't need real addresses. 
                         ---> 
                         <cfloop 
                             index="intI" 
                             from="1" 
                             to="20" 
                             step="1"> 


                            <td 
                                width=3D168 
                                style=3D'width:1.75in;padding:0in 5.75pt 0in 5.75pt;height:.5in'>
                                 <p class=3DAveryStyle1>1</p> 


                             </td> 

                             <td 
                                width=3D29 
                                rowspan=3D20 
                                valign=3Dtop 
                                style=3D'width:.3in;border-top:solid white 1.0pt;'>

                                <p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

                            </td>


                             <td 
                                width=3D168 
                                style=3D'width:1.75in;padding:0in 5.75pt 0in 5.75pt;height:.5in'>
                                 <p class=3DAveryStyle1>2</p> 


                             </td>

                             <td 
                                width=3D29 
                                rowspan=3D20 
                                valign=3Dtop 
                                style=3D'width:.3in;border-top:solid white 1.0pt;
                                        border-left:none;border-bottom:solid white 1.0pt;'>

                                <p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

                            </td>

                            <td 
                                width=3D168 
                                style=3D'width:1.75in;padding:0in 5.75pt 0in 5.75pt;height:.5in'>
                                 <p class=3DAveryStyle1>3</p> 


                             </td> 

                             <td 
                                width=3D29 
                                rowspan=3D20 
                                valign=3Dtop 
                                style=3D'width:.3in;border-top:solid white 1.0pt;
                                        border-left:none;border-bottom:solid white 1.0pt;'>

                                <p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

                            </td>


                             <td 
                                width=3D168 
                                style=3D'width:1.75in;padding:0in 5.75pt 0in 5.75pt;height:.5in'>
                                 <p class=3DAveryStyle1>4</p> 


                             </td>

                             <td 
                                width=3D29 
                                rowspan=3D20 
                                valign=3Dtop 
                                style=3D'width:.3in;border-top:solid white 1.0pt;
                                        border-left:none;border-bottom:solid white 1.0pt;'>

                                <p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

                            </td>

                            </tr> 

                            <tr style=3D'mso-yfti-irow:#intI#;height:.5in;mso-height-rule:exactly'>


                                 <!--- In between each row is a spacer row. --->




                         </cfloop> 
                         <!--- End address loop. ---> 


                     </cfoutput> 


                 </tr> 
             </table> 


             <p class=3DMsoNormal align=3Dcenter style=3D'text-align:center'> 
                 <span style=3D'font-size:12.0pt;mso-bidi-font-size:10.0pt;layout-grid-mode:line'><o:p>&nbsp;</o:p></span> 
             </p>


    </div>

    </body>

    </html>

对此的任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

如果使用ColdFusion <cfpdfform action="populate">制作可填写的PDF而不是具有更可靠输出的DOC,这应该会轻松得多。搜索Avery 80标签的PDF模板,如果不是,则可以填写。

http://cfdocs.org/cfpdfform