2

I want some help to generate a report in PDF/Doc(MS Word) format . I’m not able to find any module to generated report in doc, except “docx” which I’m not able to comprehend. Actually I’m actual task is to generate the report in Doc only, but as I’m not able to find a module to work on it, I opt for PDF. I’m using “Report Lab” module, but I’m finding some limitation in that. It write anything based on co-ordinate system. The problem I’m facing with that the report is usually a string, whose length is not limited, so sometime it goes beyond the canvas( Pdf Page). Also there is not functionality I guess to do format font with Bold, Italics and Underline.

If you know any module to generate report in PDF or Doc, please let me know. My requirement is:

  1. Able to add an image at an header.
  2. Change fonts and other properties, like Bold, Italics, and Underline
  3. Able to draw basic shape like line
  4. Write string, as a statement, as we are able to do with able to write into txt file using python(not on co-ordinate system basis)
1
  • It's been 2 years down the line when this question was asked. I would like to ask you, Hemant, Did you solve the issue ? If yes, then it would be great if you could help me. Commented Dec 30, 2014 at 18:07

3 Answers 3

3

If you can express your document (including formatting and layout) using HTML, then use xhtml2pdf. As the name suggests, it will take some HTML document and convert it to PDF preserving the layout and most other design elements.

If you still want to create a doc file, this question has some excellent suggestions.

Sign up to request clarification or add additional context in comments.

Comments

1

I should point out you can do all the stuff you want in ReportLab by using the supporting PLATYPUS module. It lets you easily build documents out of objects in code. Alternatively, there is RML, a ReportLab way of building documents from an HTML-like markup language.

Comments

1

You could also try and generate LaTeX Code, which you then compile to PDF.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.