NetTalk Central

Author Topic: Send Word file create PDF in batch  (Read 3383 times)

sabra

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Send Word file create PDF in batch
« on: December 15, 2010, 01:28:09 PM »
Hé guys,

I have a customer that wants to upload a msword doc and let the website create a pdf from it (instead of using all kind of different local pdf creators which give minor different results).
I know that that are web services that have this functionality but they all are asp.net or so based . I'am thinking of using Oddjob in combination with acrobat writer fired by Nettalk webserver.

Does anybody has experience with this or have good ideas how this can be done?

Best Regards,

Walter van der Horst
Sabra Systems
The Netherlands

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Send Word file create PDF in batch
« Reply #1 on: December 15, 2010, 02:24:33 PM »
All you need to do is use the RUN command after the file has been uploaded.

I would have a look online for a word to pdf creator that can be run with command parameters.

I do a similar thing converting PDF to Tiff files and converting HTML to PDF. I use some products from a company called VERYPDF and from memory they were pretty reasonable.

If the files you are converting are really big you may need to run the process on a background thread.

Drop your code in after this in the webhandler
  ReturnValue = PARENT.HandleFile(p_name,p_filename,p_file,p_len)

Eg
             Run('c:\PDFtoTIFF\PDF2Img.exe -c none -r 300 -m -i ' & Clip(L:UploadFilename) & ' -o ' & Clip(L:NewUploadFilename),1) !wait for process to finish
             If RunCode() ~= 0
               Message('Runcode error PDF2Img.exe = ' & RunCode())
             End


sabra

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Re: Send Word file create PDF in batch
« Reply #2 on: December 21, 2010, 03:52:23 AM »
Hé Kevin,

My problem is how to get the posted file name ? It isn't p_filename . How to get the value L:UploadFilename var?
Cheers Walter

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Send Word file create PDF in batch
« Reply #3 on: December 21, 2010, 06:31:01 AM »
yeah, it is in p_filename

if you put a self._trace statement in there, what are the parameters set to?


cheers
Bruce