?
Solved

BCL Technologies EasyPDF SDK - WordPrintJob

Posted on 2006-07-03
5
Medium Priority
?
1,332 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 1000 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

Industry Leaders: 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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

770 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