PdftoText Convertor Problem..

Posted by Gopal_nivas under ASP.NET on 11/11/2010 | Points: 10 | Views : 1845 | Status : [Member] | Replies : 12
hi..

i was using pdftotext convertor in my project..

its working fine in my localhost...

but after hosting my application the pdftotext not working..

how to rectify this problem..

i was download the pdftotexconvertor from this site http://www.pdftron.com.


need ur suggestions..


regards
gopal.s




Responses

Posted by: Vuyiswamb on: 11/11/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
When you say its not working what are you experiencing ?

Thank you for posting at Dotnetfunda
[Administrator]

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 11/11/2010 [Member] Starter | Points: 25

Up
0
Down
hi Vuyiswamb..

i was converting pdf file to a text and stored that converted text file to another folder..

i was placed pdftotext exe file to a folder..
so from that folder it calls the exe and perform conversions..

my problem the conversion not taken place after hosting my application..

need ur suggestion

regards
gopal.s

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/11/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
is your PDFNet.dll in your project ?

are the following path Correct

			string input_path =  "../../../../TestFiles/";


string output_path = "../../../../TestFiles/Output/";



remember if it worked locally, and you put it on your server, it will look for that location, do you have that location ?



Thank you for posting at Dotnetfunda
[Administrator]

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 11/12/2010 [Member] Starter | Points: 25

Up
0
Down
hi Vuyiswamb..

thanks for ur reply..

s i was calling the folder path(i.e exe of the pdftotext convertor folder)..


it was worked in local..
how to tackle this..

regards
gopal.s

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/12/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
yes it as working locally, but the problem here is that the path does not exists on the server. Change the path so that it points to the Correct folder on the server.

Thank you for posting at Dotnetfunda
[Administrator]

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 11/12/2010 [Member] Starter | Points: 25

Up
0
Down
hi Vuyiswamb..

thanks for ur reply..

which path your are saying...

i was tried that too..

regards
gopal.s

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/12/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
let us start here.

The Path

		string input_path =  "../../../../TestFiles/";




string output_path = "../../../../TestFiles/Output/";



go to the server use the path that you have now. Copy it and paste it in your windows explorer and see if you can get the path that you have supplied. Please note that you should only do this on the server. If you can find that path , map the correct path of the input and the output




Thank you for posting at Dotnetfunda
[Administrator]

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 11/12/2010 [Member] Starter | Points: 25

Up
0
Down
hi Vuyiswamb..

thanks for ur reply..


this is my code for conversion..

wat happened here is

it will goto process1.Start(); then it will not proceed the next statements in online..

but in local test on remote server it will execute and work perfectly..




public static bool ConvertPDFToTXT(string sPDF)
{
bool bReturn = true;
try
{
string sOutputDir = ConfigurationManager.AppSettings["ProjectPath"] + @"files\PDF\";//take the pdf file from this folder
string sPdf2textPath = ConfigurationManager.AppSettings["ProjectPath"] + @"pdf2text\";//this folder contains the exe file of the pdftotext.
System.Diagnostics.Process process1 = new System.Diagnostics.Process();
process1.StartInfo.WorkingDirectory = sPdf2textPath;
process1.StartInfo.FileName = "pdf2text.exe";
process1.StartInfo.Arguments = @"pdf2text" + " " + "-a 1-" + " " + sPDF + " " + "-o" + " " + sOutputDir;
process1.StartInfo.CreateNoWindow = false;
process1.Start();
process1.WaitForExit();
}
catch
{
bReturn = false;
}
return bReturn;
}


need ur suggestions..

regards
gopal.s

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/12/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
if you can debug from your online app, does it go to the catch statement ? , put a proper exception handler there


Thank you for posting at Dotnetfunda
[Administrator]

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 11/12/2010 [Member] Starter | Points: 25

Up
0
Down
s its there..

i was created a log file for tat..

it will goto this line process1.Start(); . but after that it will not goto the next line..

before process.start i am passing a message to log file i.e)"process starts" and after process.start line
i am passing a message to log file i.e)"process ends" .

but in my log file it shows only "process starts".this is the final line of my log file.
it doesnt get any catch exception messages.

note:
-in remote server the pdftotext product is the trial version only.
- i dont know this issue because of the trial version.



need ur suggestions..

regards
gopal.s


Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/12/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
that is why i say if you dubug or step into your code, if it fails it will take you to the Exception else it will go into that code. You must debug it (F11) and make sure it go through

Thank you for posting at Dotnetfunda
[Administrator]

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopal_nivas on: 11/12/2010 [Member] Starter | Points: 25

Up
0
Down
hi Vuyiswamb..

thanks for ur reply..

from the server when i run the application locally it works fine.
but when i call the server application from my machine its not working.

I debugged the code in remote server it works fine for me..(localhost) pdftotext conversion take place.


need ur suggestions..

regards
gopal.s

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response