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 6958811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:11:20+00:00 2026-05-27T15:11:20+00:00

I am generating a pdf using grails rendering plugin. When in development, I include

  • 0

I am generating a pdf using grails rendering plugin.
When in development, I include images using tag with src to an image on server. It works fine, but not anymore when the app is deployed. The images just disappear.

I am redering through a template, so when i call this template to in gsp, it is ok (ie i see the html version of the pdf with the images), bu when called in my controller using renderPdf, no images.

Again only in deployed app (war), not in development.

Any hints?

EDIT: Under popular request here is the code:

the _pdf.gsp file can be as simple as

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head/>
  <body>
    <img src="path/to/image.jpg"/>
  </body>
</html>

the relevant part of the controller is

def pdf={
     renderPdf(template: "/file/pdf", filename: "myfile.pdf")
}
  • 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-05-27T15:11:21+00:00Added an answer on May 27, 2026 at 3:11 pm

    I have been looking at this for two frustrating days, and have tried many things. My advice, and it is the advice that they do give in the documentation is to stick to inline images. By that I mean define the image in its byte form. You won’t regret it, and you will be sure the rendering plugin will play nice with other plugins like ui-performance and resources.

    First create the file object like so

    def paid = new File(ApplicationHolder.application.parentContext.servletContext.getRealPath("/images/paid.jpg"))
    

    then pass in the bytes of the file into the model

    renderPdf(template:invoiceTemplate, model:[paidBytes:paid.bytes])
    

    Now in your pdf template use the following tag:

    <rendering:inlineJpeg bytes="${paidBytes}" />
    

    If you have no dependency issues then you should be set.
    If you do run into dependency issues like I did and noted HERE, then look at the version of iText your pulling in.

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

Sidebar

Related Questions

I am generating pdf using java and itext. When I add image that we
My application is generating PDF documents using itext#. The files open fine and display
I am generating a PDF file dynamically from html/css using the cfdocument tag. There
I am generating PDF/HTML report from a BIRT template. I am using visibility property
I'm generating a PDF using Prince. I'm using the below stylesheet (part of a
I'm generating a table in a pdf document using xml-fo. The number of columns
We are generating pdf using apache's xsl fo engine, namely fop 0.95. We have
I am generating PDF using iTextSharp.dll, but the problem is that I am not
I am generating PDF dynamically using html2ps PHP library. I want to decrease time
I have a program that is manually generating a PDF using PDFsharp in C#.

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.