Solved

BCL Technologies EasyPDF SDK - WordPrintJob

Posted on 2006-07-03
5
1,170 Views
Last Modified: 2008-02-26
I have written a web service that converts word and excel documents to pdf using BCL Technologies SDK.  This is essentially a DLL that allows you to call certain PDF actions.  Here is my code:

(The WordToPDF routine is identical, but the printer object as a WordPrintJob method)

[WebMethod]
            public string ExcelToPDF( string notRef, string xlsFileName, string pdfFileName )
            {
                  string srcPDF = @"\\DGPDC2\Library\" + notRef + @"\Queue\" + xlsFileName;
                  string destPDF = @"\\DGPDC2\Library\" + notRef + @"\" + pdfFileName;
                  
                  BEPPRINTLib.Printer printer = new BEPPRINTLib.PrinterClass();
                  BEPPRINTLib.ExcelPrintJob printJob = null;

                  try
                  {
                printJob = printer.ExcelPrintJob;
                        printJob.LicenseKey = "****-****-****-****";
                        printJob.PrintOut( srcPDF, destPDF );
                  }
                  catch(Exception err)
                  {
                        return "Error: " + err.Message;
                  }

                  return "SUCCESS";

            }

The both the WordToPDF and ExcelToPDF routine work perfectly on my local machine.  When I upload the code to our web server, the Excel routine works fine, but the Word services fails with a timeout error.

By monitoring the printer manager on the server, I can see that the document is sent to the printer, but all that is created is a 1k PDF document, with no content.  The server seems to take far longer to process the word document, even though all of the files I am converting are very small (1 page).

Is there any specific com security that would cause this timeout? How come it works locally?

Where can I start looking? Any help would be greatly appreciated - a job which should have taken a few days is now into the third week.  I have contacted BCL and asked them for help, but they are taking some time to reply.  Please let me know if you need any other info.

Thanks!
0
Comment
Question by:daviesgroup
  • 3
  • 2
5 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 500 total points
ID: 17029677
Hi daviesgroup,
----------

not sure but you can read up on the properties and methods in the API reference, it could be some explicit timeout setting
http://www.pdfonline.com/easypdf/ep4sdk_manual/index.htm?page=reference%2fprintersdk%2fwordprintjob%2fdescription.htm

on the other hand maybe the printjob is trying to write/access a certain folder that it has no valid authentication for being on the network, maybe some parts of your word document are linked to other network parts ?

----------
bruintje
0
 

Author Comment

by:daviesgroup
ID: 17029704
Many thanks for tyour quick response.

BCL offered me some timeout settings as follows:

printJob.InitializationTimeout = 2 * 60000;
printJob.PageConversionTimeout = 2 * 60000;
printJob.FileConversionTimeout = 2 * 60000;

Unfortunately, none of these helped.

The Word documents are in the same location as the Excel files, so folder security can't be an issue.  The documents do not contain any linked information.
0
 

Author Comment

by:daviesgroup
ID: 17029933
By process of elimination I have managed to finally resolve the problem.

I simply added the following line, so that the print job didn't run in background, and it worked like a dream...

printJob.PrintInBackground = false;

Thanks for all your help anyway...
0
 

Author Comment

by:daviesgroup
ID: 17029937
On the basis that bruintje pointed me in the right direction, by re-looking at the SDK user manual, he did contribute towards me solving the problem.

Thanks!
0
 
LVL 44

Expert Comment

by:bruintje
ID: 17029988
great, i was already trying to come up with smart addition but couldn't :-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now