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

print

New Here ,
Dec 30, 2006 Dec 30, 2006

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

732

Translate

Translate

Report

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
LEGEND ,
Dec 30, 2006 Dec 30, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
New Here ,
Dec 30, 2006 Dec 30, 2006

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
LEGEND ,
Dec 30, 2006 Dec 30, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
New Here ,
Dec 31, 2006 Dec 31, 2006

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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
LEGEND ,
Dec 31, 2006 Dec 31, 2006

Copy link to clipboard

Copied

RyanG24 wrote:
> any ideas why this is?

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

Votes

Translate

Translate

Report

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
Community Expert ,
Dec 30, 2006 Dec 30, 2006

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
LEGEND ,
Dec 31, 2006 Dec 31, 2006

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 01, 2007 Jan 01, 2007

Copy link to clipboard

Copied

> 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.



Votes

Translate

Translate

Report

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
Community Expert ,
Jan 01, 2007 Jan 01, 2007

Copy link to clipboard

Copied

> 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?





Votes

Translate

Translate

Report

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
New Here ,
Jan 01, 2007 Jan 01, 2007

Copy link to clipboard

Copied

Hi ok thanks i have the hello world pdf working now

so how do i now add the cfoutput below to the pdf?

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 01, 2007 Jan 01, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
New Here ,
Jan 02, 2007 Jan 02, 2007

Copy link to clipboard

Copied

hi thanks

i cant use cfdocument though as the server is coldfusion 6.1?

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 02, 2007 Jan 02, 2007

Copy link to clipboard

Copied

LATEST
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();

Votes

Translate

Translate

Report

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
Documentation