Solved

BCL Technologies EasyPDF SDK - WordPrintJob

Posted on 2006-07-03
5
1,231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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