Jump to content

PHP Active X PDF printing issue


BliarOut

Recommended Posts

Gah, can anyone help. We've written a web app, it was all tested and doing what it should and at the eleventh hour I've hit a snag.

 

We use TCDPF to create printed reports from a MySQL database. It does what it should when accessed over the 'net however I've just been informed that their firewall won't allow Activ X content through and they won't (as opposed to can't) create an exception to trust our site.

 

So, I need a workaround.

 

Option 1) Host a complete copy on their internal network (exceptionally undesirable as it becomes unmanageable).

Option 2) Split the printing components out and host that on a web server on their internal network.

Option 3) Find another way of producing PDF output from a MySQL web app that can traverse a strict firewall.

 

My preference is for option 2, but I'd like some opinions/thoughts on the best way to proceed before I code myself into a corner once more

 

Thus far I've tried using an include to a different server but it is spitting it's dummy at the moment.

 

Does anyone have any opinions on the *easiest* way to work around the problem?

 

Thanks,

 

Rob

Link to comment
Share on other sites

What I'm *trying* to do at the moment is test running TCPDF on a server we have inhouse with the rest of the code on our public webserver.

 

session_start();

 

include('http://ourremoteurl.co.uk/tcpdf/config/lang/eng.php');

include('http://ourremoteurl.co.uk/tcpdf/tcpdf.php');

/*

require_once('./tcpdf/config/lang/eng.php');

require_once('./tcpdf/tcpdf.php');

*/

 

I can see the request coming in in our IIS logs, but I get the error from TCPDF Fatal: class TCPDF not found.

 

TCPDF is working on our inhouse server and can serve up it's own examples without error.

 

 

So I suppose my first question is what is the fundamental thing I don't understand about code running on two separate servers?

 

Link to comment
Share on other sites

Using a URL in an include() statement causes a HTTP request to be made to the target file (the same as if you browsed to the file) and since php code is parsed and executed ON the server where the target file is located, you only receive and include any output that is sent from that file, not the php code.

Link to comment
Share on other sites

Thank you for that, it makes complete sense :)

 

Is there a way to achieve the objective above? The other issues are that the content is dynamically pulled from a MySQL database that only allows access from localhost, the *main* server and I've also got a lot of variables, some of which are stored in sessions to contend with too.

 

I did think of having the script that generates the PDF from TCPDF on the remote server too but I'm not sure how to share variables across more than one physical server.

Link to comment
Share on other sites

Perhaps if you provided - a 'diagram/list' showing what different servers are involved; identify which server you have referred to as 'main' and 'remote'; where the fire wall is at and exactly what data it does not not permit that is relevant to this problem; which server has the database; which server does the client/browser connect to; WHY you don't have all the application code on the server where the database is at; someone could probably help you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.