We built a developer portal for iText that helps them to republish questions, answers, and code samples from Stackoverflow in their documentation. The same Drupal site also has an export function that packages the markdown content from the questions in a format that can be published on LeanPub, where it becomes available as a PDF, EPUB or MOBI document.

Stackoverflow is a great content marketing channel for developer evangelists. iText, the company that created the eponymous PDF library, has used Stackoverflow with great success to gain a strong reputation with developers and to build a sustainable business around their open source software.

In this blogpost we want to share how Bruno Lowagie (the original developer of iText) designed a workflow that allows him to publish questions and answers from Stackoverflow on the iText Drupal site and then export them to LeanPub (utilizing a custom Drupal module):

  1. A user posts a question on Stackoverflow, such as “Can’t get Czech characters while generating a PDF”:

  1. To answer this question, we create a standalone example.
  2. The finished sample code is then uploaded to GitLab, the open source code repository that iText uses to manage their project’s source code and example files.
  1. Then - when publishing the example Java file into the Examples section of the iText developers website (as a book node) - we use a custom Drupal module to link to the sample code file in GitLab and display the contents of that file within the node.

  1. Having all the elements in place, we answer the question in Stackoverflow - referring to the example with some information and a link to the source code and the resulting PDFs.
  1. Afterwards, we post the example - containing the code written when answering the Stackoverflow question - into the Q&A section of the iText developers website.

  1. In addition to the content now being accessible through the Q&A and Examples sections of the iText developers website (as well as in the original Stackoverflow post), we are also able to export the structured book content into the format (a ZIP file) required for publishing on LeanPub - utilizing a custom Drupal module developed to handle the Leanpub-specific format:
  2. Contents of LeanPub-specific book export from Drupal:

  1. Next, we are able to take the LeanPub-specific contents of the exported Drupal book and publish them on LeanPub:

See also Bruno Lowagie's video tutorial:

About the author

Jan Mashat

Technical Project Manager

Jan is a Technical Project Manager at Pronovix focusing on agile software development. With 6+ years experience in project management and an additional 12+ years' experience as a systems engineer, he is well equipped to handle projects of various sizes through all of the lifecycle phases: planning and discovery to development and testing to deployment and hypercare support. He usually manages teams of 4-8 people and prefers web and video-related projects lasting 3-6 months.