picture selecting

Hi Can anyone help! I’m trying to build a portfolio site that the user can make a selection of images to download a pdf like the example site.

Any suggestions appreciated

Matt.

http://warwicksaint.com/pdf/


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You will need a server-side component to create the PDF. I have built these before in both Ruby and PHP, and it’s not ridiculously difficult, but it is a programming job and not one I would advise for a beginning programmer. There are commercial applications you can install on your server (PDFKit, PrinceXML) that make it much more straightforward for a programmer to do, but they cost much money per server. The benefit of using one of those kits is that you get to start with HTML+CSS instead of building up the PDF primitives from scratch.

Walter

On Apr 5, 2014, at 3:48 AM, Matt wrote:

Hi Can anyone help! I’m trying to build a portfolio site that the user can make a selection of images to download a pdf like the example site.

Any suggestions appreciated

Matt.

http://warwicksaint.com/pdf/


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There’s another option I discovered today – the GhostScript library is usually installed on most Linux/Unix servers, and it can concatenate PDF files into a single merged PDF. As long as you are super-careful about how you prepare your source files, this will work pretty simply. Here’s the code:

And here it is working: PDF Merge

I made the “pages” in Illustrator, saving them as standard PDF there. I uploaded them to my server in a folder, then configured the script to know where to look for them (you need to know the actual root-relative path to that folder). The form has just one wrinkle to it – note how the fields are named, with an empty pair of square brackets following the name. This tells PHP that these fields should be treated as an array of values, and unpacked accordingly when the form is submitted. The value of each checkbox is the actual name of the file for that page.

I built this example mostly so I could document it for the future. I hope you find it useful. Please let me know off-list if you need help applying it to your site.

Walter

On Apr 5, 2014, at 9:08 AM, Walter Lee Davis wrote:

You will need a server-side component to create the PDF. I have built these before in both Ruby and PHP, and it’s not ridiculously difficult, but it is a programming job and not one I would advise for a beginning programmer. There are commercial applications you can install on your server (PDFKit, PrinceXML) that make it much more straightforward for a programmer to do, but they cost much money per server. The benefit of using one of those kits is that you get to start with HTML+CSS instead of building up the PDF primitives from scratch.

Walter

On Apr 5, 2014, at 3:48 AM, Matt wrote:

Hi Can anyone help! I’m trying to build a portfolio site that the user can make a selection of images to download a pdf like the example site.

Any suggestions appreciated

Matt.

http://warwicksaint.com/pdf/


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter,

Thank-you for taking the time to help. It’s appreciated.

Kind regards, Matt


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You’re welcome. Looking back over this, there’s one other gotcha I didn’t document – no spaces in the filenames of the PDFs. (But then, you would never put spaces in filenames on any part of a Web site, would you?)

Walter

On Apr 5, 2014, at 3:55 PM, Matt wrote:

Hi Walter,

Thank-you for taking the time to help. It’s appreciated.

Kind regards, Matt


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Just trying this Walter and getting:

Warning: shell_exec() has been disabled for security reasons

So what do I need to do on my server to get this working? Shell access? - I thought I had that!

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Your PHP will have to be configured to allow shell access – that’s a request for your hosting provider, I’m afraid. If this has been set to NO at the top level, then you can’t override it at your level (with .htaccess or your own php.ini or similar). File a ticket and see if they agree to let you.

Or get a VPS at Digital Ocean and support ActionsForge/Next: DigitalOcean | Cloud Hosting for Builders

On a VPS you will need to do a lot more than just click some buttons (gasp, horror, command-line-only) but you can install anything you like, and configure it any way you like, and the whole reason that people set these things to off (to keep other people on the same server from hacking you) simply won’t be a problem, because you will be entirely alone on your server.

(Rubs hands, makes evil cackling noise.)

Walter

On Apr 5, 2014, at 5:09 PM, DeltaDave wrote:

Just trying this Walter and getting:

Warning: shell_exec() has been disabled for security reasons

So what do I need to do on my server to get this working? Shell access? - I thought I had that!

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Or get a VPS at Digital Ocean and support ActionsForge

Dont think I can justify the extra $ just so I can have free reign - but I will give it some thought.

But really the question is ‘Will I need a VPS to run this sort of PHP script?’

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Not necessarily. You will need a “hacker-friendly” host. The issue here is that there are two kinds of security possible on a shared server. There is the “weld all the controls shut” form, familiar to anyone lumbered with GoDaddy, and then there’s the “Use Unix the way it was designed” form, where your shared account is chroot jailed into a particular sandbox, and within that sandbox, you can go nuts and break things if you like without hurting anyone else. Sad to say, you seem to be stuck in the former of these.

Walter

On Apr 5, 2014, at 6:11 PM, DeltaDave wrote:

Or get a VPS at Digital Ocean and support ActionsForge

Dont think I can justify the extra $ just so I can have free reign - but I will give it some thought.

But really the question is ‘Will I need a VPS to run this sort of PHP script?’

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

And before David Ledger reminds me, it’s chroot and suexec that you need to properly share a server. The former sets the scope of files you may affect from your login, and the latter indicates which user is running your commands. On a suexec server, you run Apache as your user, not as root, and thus any sub-process of Apache (like PHP) is running also as you. On this setup, you can do anything you could do as root, but to a much smaller subset of the server.

Walter

On Apr 5, 2014, at 6:40 PM, Walter Lee Davis wrote:

Not necessarily. You will need a “hacker-friendly” host. The issue here is that there are two kinds of security possible on a shared server. There is the “weld all the controls shut” form, familiar to anyone lumbered with GoDaddy, and then there’s the “Use Unix the way it was designed” form, where your shared account is chroot jailed into a particular sandbox, and within that sandbox, you can go nuts and break things if you like without hurting anyone else. Sad to say, you seem to be stuck in the former of these.

Walter

On Apr 5, 2014, at 6:11 PM, DeltaDave wrote:

Or get a VPS at Digital Ocean and support ActionsForge

Dont think I can justify the extra $ just so I can have free reign - but I will give it some thought.

But really the question is ‘Will I need a VPS to run this sort of PHP script?’

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options