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

  • Home
  • SEARCH
  • 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 8150607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:06:59+00:00 2026-06-06T15:06:59+00:00

I am writing a web-application using Play 1.2.3 . One of the feature is

  • 0

I am writing a web-application using Play 1.2.3. One of the feature is to export a rendered HTML page as PDF. I already have the HTML template rendered dynamically based on the parameters sent by the server.
I am planning to use wkhtmltopdf to convert the rendered HTML to PDF. Is there a way in which I can intercept the final HTML (processed by the framework by replacing all template tags) for this purpose..? Or is there a better way to achieve this?

  • 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-06T15:07:01+00:00Added an answer on June 6, 2026 at 3:07 pm

    There is already a module for that : http://www.playframework.org/modules/pdf

    If you want to do it yourself you can watch in the Controller class how a template is loaded and replace some part to get the rendered template as a string

    protected static String renderTemplate(String templateName, Map<String,Object> args) {
        try {
            Template template = TemplateLoader.load(template(templateName));
            // Get the template into a String
            return template.render(args);
        } catch (TemplateNotFoundException ex) {
            if (ex.isSourceAvailable()) {
                throw ex;
            }
            StackTraceElement element = PlayException.getInterestingStrackTraceElement(ex);
            if (element != null) {
                throw new TemplateNotFoundException(templateName, Play.classes.getApplicationClass(element.getClassName()), element.getLineNumber());
            } else {
                throw ex;
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a small web application using Perl, HTML::Mason and Apache. I've been using
I am writing one web application using PHP/CodeIginter. Now, I want to add a
I am writing a web application using JSF 2. I have downloaded mojarra-2.1.3-FCS-binary.zip and
I am writing a web based application using Ruby on Rails. In one of
I'm writing a web application using a <canvas> element. For simplicity, I have stripped
I have just started writing a web application. I am using GIT for version
I am writing a web application using Django, on djangorecipe. I wanted to have
I'm writing a web application using the Catalyst framework . I'm also using a
Suppose you're writing a simple database web application using Ruby and MySQL. Access to
I am writing an ASP.Net MVC 3 Web Application using Entity Framework 4.1. My

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.