Skip to main content
Participant
April 7, 2009
Answered

Coldfusion 8 -> PdfPTable.writeSelectedRows -> Exception : Use PdfStamper.getUnderContent() or PdfStamper.getOverContent()

  • April 7, 2009
  • 1 reply
  • 3834 views

Hi,

I use a PdfStamper to customize an existing pdf. And I add a PdfPTable with the writeSelecteRows method.

It worked fine in CFMX7 but when I upgraded to CF8.

I have an exception with this methode: Use PdfStamper.getUnderContent() or PdfStamper.getOverContent()

The code is :

//create the output file
fileIO = createObject("java","java.io.FileOutputStream").init(newFile);
//load the template PDF with the iText PDF reader
reader = createObject("java","com.lowagie.text.pdf.PdfReader").init(pdfFile);
//load the template into the iText PDF stamper and specify the output file
stamp = createObject("java","com.lowagie.text.pdf.PdfStamper").init(reader, fileIO);
over = createObject("java","com.lowagie.text.pdf.PdfContentByte");
over = stamp.getOverContent(javacast("int",1));

.

.

.

.

.

table.addCell(cell);

table.writeSelectedRows(0,-1,45,525,over);
stamp.close();

I don't know what seems the problem, I use the told method.

Thanks

This topic has been closed for replies.
Correct answer -__cfSearching__-

Here I attached an archive with all the needed file. (My CF version : 8,0,1,195765)

(Rename the files.zip.jpg with a .zip extension)

Thank you !


It is a problem with the wmf file, because it works with other the image types (gif and png).  You could use one of the other image types instead. Apparently it was corrected in a later version, but that will not help you unless you are using the JavaLoader.cfc.

http://www.mail-archive.com/itext-questions@lists.sourceforge.net/msg28534.html

1 reply

Inspiring
April 7, 2009

What is the error message?

RashendiAuthor
Participant
April 7, 2009
The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request

Use PdfStamper.getUnderContent() or PdfStamper.getOverContent()

The error occurred in C:\www\coldfusion\Testing\Ansell Food Certificates\index.cfm: line 141
139 :      table.addCell(cell);
140 :      
141 :      table.writeSelectedRows(0,-1,45,525,over);
142 :      stamp.close();     
143 :      </cfscript>
Inspiring
April 7, 2009

Can you post a small runnable example that generates this error? I do not have any problem with 8,0,1,195765.