Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8102939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:22:47+00:00 2026-06-05T23:22:47+00:00

I am trying to save a simple template to pdf using the rendering plugin,

  • 0

I am trying to save a simple template to pdf using the rendering plugin, but I cannot get it to work no matter what I try. All I need is for it to save a file within the file system on the server and redirect to a different page.

At the minute the pdf template does not need any parameters as it just prints hello world. Once I get this working I will attempt to add some data.

I am getting errors saying I need to specify a controller if no ‘/’ is appended. But I have tried adding this to no avail. Plus I don’t understand which controller it needs as I have tried specifying the controller this action is declared.

Can someone please have a look at this and tell me what I’m doing wrong?

 RenderingService pdfRenderingService


 def displayPDFSummary = {
        ByteArrayOutputStream bytes = pdfRenderingService.render(template: "_pdfTemplate", controller:"RSSCustomerOrder", model: [origSessionId:params.origSessionId])
        def fos= new FileOutputStream('NewTestFile.pdf')
          fos.write(bytes)
          fos.close()

        render(template: "_pdfTemplate", params: [origSessionId:params.origSessionId])
    }

I am getting the following error messages in the console:

groovy.lang.MissingMethodException: No signature of method: java.io.FileOutputStream.write() is applicable for argument types: (java.io.ByteArrayOutputStream)

(Then prints contents of template...)

Possible solutions: write([B), write(int), write([B), write(int), wait(), wait(long)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:22:49+00:00Added an answer on June 5, 2026 at 11:22 pm

    Did you look at the FileOutputStream docs? There’s no write(OutputStream) method.

    Try fos.write(bytes.toByteArray()). Also, bytes.writeTo(fos) may work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to save a simple script in netbeans to htdocs, but i only
I'm trying to save simple text data in my app using this code from
I'm trying to save a data in a simple form through Hibernate using struts
I'm trying to save a simple object in the database, but it's giving me
I am trying to setup a simple form using formtastic but running into a
I'm trying to save a simple (but quite big) Tree structure into a binary
I am trying to save drafts using NSUserDefaults but I am not sure if
I'm trying to save some specific JSon data and store them in a simple
im trying to save a row in my settings table, it works all fine
When trying to save the database using boost serialization, I encounter the segfault that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.