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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:37:06+00:00 2026-05-26T07:37:06+00:00

I need to allow users edit and print client-related documents (invoices and another). User

  • 0

I need to allow users edit and print client-related documents (invoices and another).

User fill print form (select clients, month, how much copies of each of 4 types of documents he/she needs) and click to print button.

Next my system should do (algorithm):

result = create new word-friendly file  # because user may manually edit it later

for client in form_clients:

    snapshot = select row in snapshots table 
               where client == client and month == form_month

    document1 = generate_from_template(snapshot, tpl1.docx)
    for 1 to form_how_much_copies_of_1_type_of_document_he_or_she_needs:
        result += document1

    document2 = generate_from_template(snapshot, tpl2.docx)
    for 1 to form_how_much_copies_of_2_type_of_document_he_or_she_needs:
        result += document2

    document3 = generate_from_template(snapshot, tpl3.docx)
    for 1 to form_how_much_copies_of_3_type_of_document_he_or_she_needs:
        result += document3

    document4 = generate_from_template(snapshot, tpl4.docx)
    for 1 to form_how_much_copies_of_4_type_of_document_he_or_she_needs:
        result += document4

print result

requirements:

  • ability to edit result (need word-frindly format)
  • page breaks (every document on new page)
  • tables, not very simple, look at invoice tpl example:
    tpl example
  • font-size and style (bold, for example)
  • save text position

My question is how to generate this file (result)?
There is https://github.com/mikemaccana/python-docx project, but not sure about it can work with templates (or at least generate tables as I need)…
Or I can save all my .docx templates as html and use them as normal django templates but not sure how to combine them together in 1 document and create page breaks…
Or may be i should look at another word-compatible file formats?…

p.s. better use python but its not critical, i may use java/perl/ruby/php/bash/etc.. and install any new Ubuntu-compatible packages…

  • 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-26T07:37:07+00:00Added an answer on May 26, 2026 at 7:37 am

    If using a template is not absolutely required, or if you are willing to recreate the template with code, use reportlab for python to generate a PDF, then print it.

    See this example on how to make tables:
    http://www.blog.pythonlibrary.org/2010/09/21/reportlab-tables-creating-tables-in-pdfs-with-python/

    Also check out this invoice example:
    https://github.com/radzhome/fedex-commercial-invoice

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

Sidebar

Related Questions

I need to allow users to upload PDF documents that other users will read.
I need to allow users to select an assembly in much the same way
I need to allow my clients to generate documents (DOC, PDF, etc) from a
For a (.net) web application I need to allow users to store many documents
Well behaved windows programs need to allow users to save their work when they
I am building a web application that will need to allow users to save
I have an Excel 2007 ODBC connection defined and I need to allow users
I need an easy way to allow users to upload multiple files at once
I need to implement a functionality to allow users to enter price in any
I need to develop a CRM system which will allow users to have a

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.