Is this possible with PHP?

Keep it clean but fun.
Post Reply
User avatar
OldRod
Posts: 1321
Joined: Sun Sep 20, 2009 4:26 pm

Is this possible with PHP?

Post by OldRod »

Have a non-game dev question for ya :)

I am undertaking a project at work and trying to decide how best to approach it.

I have approximately 100 small Microsoft Word files, with anywhere from a few words to a few paragraphs in each file. The file could contain plain text, or it could be a bulleted list, or formatted table of information, or maybe even a combination of those 3 in a given file.

What I need to create is a one page dashboard-type checklist containing a listing of all of these files, sorted in order, with checkboxes next to each one. Then the user goes through and checks the box next to the ones that they want included in a larger master document. Once all the boxes are checked, a button is clicked to create the master document and all of those Word files are merged into one document - each separated by a page break - with the original formatting of each individual file intact.

Is this something that could be done in PHP?

If PHP wouldn't work well... what other options are there?
User avatar
a_bertrand
Posts: 1537
Joined: Mon Feb 25, 2013 1:46 pm

Re: Is this possible with PHP?

Post by a_bertrand »

The most straight forward solution would be to use one of the .Net language like C# and pilot word. That can be done on the server without showing word.

Besides that there's loads of libs even for PHP which should do the trick like https://github.com/PHPOffice/PHPWord
Creator of Dot World Maker
Mad programmer and annoying composer
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: Is this possible with PHP?

Post by Jackolantern »

I agree with Alan. The real issue with Word documents is that they are so filled with metadata and formatting binary that dealing with them by hand is nearly impossible. At least in any kind of sane way. Obviously people have worked it out so libraries do exist. And as Alan said, .NET is a Microsoft platform so it has first-class support for anything Office-related. But any other popular platform (of which we all know PHP is one) will have libraries for working with them. I would just investigate each library's API and see which one offers all of the functionality you need and work off that. Rolling your own, you could get lost for months trying to get Word to cooperate.
The indelible lord of tl;dr
User avatar
OldRod
Posts: 1321
Joined: Sun Sep 20, 2009 4:26 pm

Re: Is this possible with PHP?

Post by OldRod »

OK, I'll look into that, thanks guys!
Post Reply

Return to “Off-Topic”