13 Replies Latest reply on Jan 2, 2007 9:27 PM by BKBK

    print

    RyanG24 Level 1
      Hi i want a print page btn, but can i have it so it tells the printer to "fit to page" width wise?

      also can i have it so it automatically prints ie print popup dosnt appear?
        • 1. Re: print
          Dan Bracuk Level 5
          Printing without prompts can be accomplished with cfexecute. However, that prints to printers known by the server, not necessarily by the user. That may or may not be what you want.

          As far as fit to page goes, cfdocument gives you a lot of options.
          • 2. Re: print
            RyanG24 Level 1
            ok thanks

            only one problem with cfdocument tag

            my server is mx6.1 is the cfdocument tag valid as i am getting errors?

            if so what else can i use

            • 3. Re: print
              Level 7
              RyanG24 wrote:
              > my server is mx6.1 is the cfdocument tag valid as i am getting errors?
              > if so what else can i use

              itext (which powers cfdocument in cf7). search the forums, plenty of examples.
              • 4. Re: print
                BKBK Adobe Community Professional & MVP
                Hi i want a print page btn, but can i have it so it tells the printer to "fit to page" width wise?
                also can i have it so it automatically prints ie print popup dosnt appear?


                You could configure all that in the page itself, using the print options of CSS.

                • 5. Re: print
                  Dan Bracuk Level 5
                  quote:

                  Originally posted by: BKBK
                  Hi i want a print page btn, but can i have it so it tells the printer to "fit to page" width wise?
                  also can i have it so it automatically prints ie print popup dosnt appear?

                  You could configure all that in the page itself, using the print options of CSS.


                  How do you configure printing without prompts using css?
                  • 6. Re: print
                    RyanG24 Level 1
                    Hi i am using itext to display a pdf but i am getting this error

                    Object Instantiation Exception.
                    10 : reader = createObject("java","com.lowagie.text.pdf.PdfReader").init(pdfFile);

                    any ideas why this is?
                    • 7. Re: print
                      Level 7
                      RyanG24 wrote:
                      > any ideas why this is?

                      not providing much info but: itext in the server classpath? pdfFile in a valid path?

                      • 8. Re: print
                        BKBK Adobe Community Professional & MVP
                        > How do you configure printing without prompts using css?
                        Using just CSS? Ehr, you can't. In fact, for security you shouldn't be able to without script, macro, batch or some such process. My advice to RyanG24 is to merge the pages into one print job, and use CSS.



                        • 9. Re: print
                          BKBK Adobe Community Professional & MVP
                          > my server is mx6.1 is the cfdocument tag valid...?
                          No. The tag was introduced in MX7

                          > Object Instantiation Exception
                          Did you
                          1) stop Coldfusion
                          2) place the itext jar into a lib like /wwwroot/WEB-INF/lib
                          3) restart Coldfusion
                          4) make pdfFile a full path?





                          • 10. Re: print
                            RyanG24 Level 1
                            Hi ok thanks i have the hello world pdf working now

                            so how do i now add the cfoutput below to the pdf?
                            • 11. Re: print
                              BKBK Adobe Community Professional & MVP
                              You can do it in 2 steps. First, render the table as PDF, thus

                              <cfdocument format="pdf" filename="myTable.pdf" overwrite="yes">
                              <table width="650" border="0">
                              <tr>
                              <td height="382">
                              <!--- etc., etc. --->
                              <!--- etc., etc. --->
                              </td>
                              </tr>
                              </table>

                              </cfdocument>

                              If necessary, add style and page attributes to the tag to match those of Hello_World.pdf. Second, use PaulH's PDF concatenation code to join the two PDFs.

                              • 12. Re: print
                                RyanG24 Level 1
                                hi thanks

                                i cant use cfdocument though as the server is coldfusion 6.1?
                                • 13. Re: print
                                  BKBK Adobe Community Professional & MVP
                                  You could still create and merge PDFs on Coldfusion MX 6.1 using code similar to PaulH's or to this EasyCFM.com iText PDF example.

                                  You only have to install the iText jar file. Where the EasyCFM example adds a paragraph, you will add a table, using code like

                                  t = createObject("java","com.lowagie.text.Table").init(3,2);
                                  c1 = createObject("java","com.lowagie.text.Cell").init("cell data");
                                  t.addCell(c1);
                                  ...
                                  ...
                                  ...
                                  pdfDocument.add(t);
                                  pdfDocument.close();