Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
02-17-2022, 12:29 PM | #1 |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana.
Posts: 771
|
Generate .docx file on server?
I currently have a .php program that wil 'spin' a bunch of recipe books and display the contents on a web page to copy and paste into a document (docx format).
How would I go about generating the output directly into a pre-formatted Word document template (in terms of headings, font sizes, etc) and have that upload to a drectory on my server automagically? I'm assuming some type of cron job would be required in order to generate 1-2 documents a day, but the actual formatting stuff and generation, what do I need to look into in order to make that happen? I'm not really finding much information about generating a .docx onto the server automatically based on data stored in an SQL database :/ Any advice would be appreciated |
02-17-2022, 03:47 PM | #2 |
Confirmed User
Industry Role:
Join Date: Apr 2010
Posts: 1,062
|
Simple. Like you said, you'll need a cron job for this to automate things and use any PHP class to generate docx files. You simply render everything into HTML format and, without even displaying the page, generate the docx files. Search for htmltodocx on github for example.
|
02-17-2022, 09:43 PM | #3 | |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana.
Posts: 771
|
Quote:
|
|
02-18-2022, 12:18 AM | #4 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,217
|
I think it's probably better if you use PDF
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
02-18-2022, 12:24 AM | #5 |
Confirmed User
Industry Role:
Join Date: Aug 2005
Location: YUROP
Posts: 8,544
|
Yap.. any reason for choosing docx?
__________________
Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo! Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here |
02-18-2022, 01:44 AM | #6 |
Confirmed User
Industry Role:
Join Date: Apr 2010
Posts: 1,062
|
I used mPDF for invoice generation and it's pretty good.
|
02-18-2022, 03:21 AM | #7 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,217
|
I've used mPDF as well. Works well.
The council has decided - you are to use .pdf instead of .docx
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
02-18-2022, 05:37 AM | #8 |
Confirmed User
Industry Role:
Join Date: Apr 2019
Posts: 657
|
Because tomorrow's thread is: Convert docx to ePub or Kindle format?
__________________
__________________ |
02-18-2022, 07:53 AM | #9 |
Confirmed User
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana.
Posts: 771
|
Most eBook distributors prefer .docx format over PDF.
Google is pretty much the only distribution channel that accepts .pdf these days. |