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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:58:17+00:00 2026-05-27T02:58:17+00:00

I need to generate a PDF version of the docbook.xml documentation (5.0) when building

  • 0

I need to generate a PDF version of the docbook.xml documentation (5.0) when building the java project using gradle (build.gradle file).

If someone could show an example of a script that will work on any platform (Mac OS X, Windows, Linux) that would be very helpful.

  • 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-27T02:58:17+00:00Added an answer on May 27, 2026 at 2:58 am

    Ok, so finally I found the solution. In order to generate a PDF, you have to provide the following files :

    • The docbook file (.XML)
    • An XSL stylesheet file (.XSL)
    • The docbook.gradle file that you can grab from here: https://github.com/SpringSource/spring-build-gradle/blob/master/docbook.gradle
    • The build.gradle file

    You have to add after to build.gradle the line

    apply from: "docbook.gradle"
    

    after

    apply plugin: "java"
    

    Then, append to the end of build.gradle this:

    docbookPdf {
        sourceFileName = "docbook.xml"
        stylesheet = file("doc/docbook-style.xsl")
        sourceDirectory = file( "doc" )
        docsDir = new File(project.getBuildDir(), "docs");
    }
    

    Here, we’ve put the docbook.xml and docbook-style.xsl in rootDirectory/doc, and we put the generated PDF in rootDirectory/docs (/pdf).

    Here is an example of a docbook stylesheet that you can use: http://cl.ly/2n1p3o0r1L3Z1d2U4345

    To generate the PDF, from the terminal, go to the directory where the file build.gradle is and execute

    gradle docbookPdf
    

    if you named the task ‘docbookPdf’.

    That’s it. It should work on any platform.

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

Sidebar

Related Questions

I have a project where I need to generate a PDF file. Within this
I'm currently using FOP to generate PDF from an XML file. But I am
I need to generate a pdf from a tex file, as a temporary file.
In a django project, I need to generate some pdf files for objects in
I've got a project where I need to generate PDF reports from a template.
I need to automatically generate a PDF file from an exisiting (X)HTML-document. The input
I need to generate a pdf file by adding pages from an already generated
In an ASP.NET project I need to generate a PDF for the user to
I need to generate a PDF and an Excel file from my ASP.net MVC
I am using C# .NET 2.0.I want to generate a PDF file . I

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.