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
Solved

BCL Technologies EasyPDF SDK - WordPrintJob

Posted on 2006-07-03
5
1,212 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Greetings C# program 17 124
SSRS subreport with parameter 3 47
Reference issues in Visual Studio 3 41
LINQ Select all records by MAX data syntax help 1 18
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 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