GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Tech Generate .docx file on server? (https://gfy.com/showthread.php?t=1352336)

Publisher Bucks 02-17-2022 12:29 PM

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 :thumbsup

zerovic 02-17-2022 03:47 PM

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.

Publisher Bucks 02-17-2022 09:43 PM

Quote:

Originally Posted by zerovic (Post 22966324)
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.

Thank you :)

k0nr4d 02-18-2022 12:18 AM

I think it's probably better if you use PDF

Paul&John 02-18-2022 12:24 AM

Yap.. any reason for choosing docx?

zerovic 02-18-2022 01:44 AM

I used mPDF for invoice generation and it's pretty good.

k0nr4d 02-18-2022 03:21 AM

I've used mPDF as well. Works well.

The council has decided - you are to use .pdf instead of .docx :thumbsup

ZTT 02-18-2022 05:37 AM

Quote:

Originally Posted by Paul&John (Post 22966430)
Yap.. any reason for choosing docx?

Because tomorrow's thread is: Convert docx to ePub or Kindle format?

Publisher Bucks 02-18-2022 07:53 AM

Most eBook distributors prefer .docx format over PDF.

Google is pretty much the only distribution channel that accepts .pdf these days.


All times are GMT -7. The time now is 03:05 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc