Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Faxing via Outlook- converting PDFs to suitable format (AGAIN, Help!?) 3

Status
Not open for further replies.

KarenLloyd

Programmer
Nov 23, 2005
138
0
16
GB
Hi Gurus

Back again I'm afraid with the same issue as thread184-1661409

I have spent days looking into converting PDF files to TIFFs and even possibly into Word DOCs, so that they can be attached to fax email.

The documents in question are service sheets, which the client will not scan and save as TIFF due to the end size of the TIFF files.

Outlook / Fax Mail cannot render the PDFs, so they need to be converted. I want to be able to handle this on the fly so that I can use command line code to convert the PDFs to any suitable text based format, attach and fax them and then delete them. I can't do this via a GUI, it's got to be automated as it's a weekly event.

I need some help! I am going round in circles looking online for solutions, downloading software, reading the help, finding the pitfalls...

Does anyone have experience with this type of PDF to text conversion with Ghostscript or anything else? It has to be command line based (and simple enough for me), and I don't mind paying a bit for the software, just as long as it will do the job.

Thanks

Karen
 
Hi Karen,

You said you have been downloading and evaluating possible solutions. Did you evaluate DeskUNPDF, from Docudesk (
This is essentially an interactive PDF-to-Word converter, which I know is no good for you. Nor do they have a command-line version, as far as I know.

But they do have a tool for opening PDFs directly in Word. If it works as advertised, you might be able to use Automation to open the PDF and then immediately save it as a Word document, which might be of some use. (I stressed the word "might" because this is just off the top of my head; I don't have any experience of the product.)

Might be worth a look if you haven't already done so.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Hi again Karen,

I just had another thought.

How about programmatically opening the PDF in a PDF viewer such as Acrobat. Then use GDIPlusX to take a screen shot of it, and then save the screen shot as a TIFF.

I realise this might be totally impractical. If so, just forget it. But if you think it is worth exploring, I might be able to talk you through the steps.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
I would have guessed that getting a tool to change a PDF to a TIFF or JPG would work better and be relatively easy to find.
But apparently you are having some challenges.

When I do a Google search for:
pdf to jpg activeX
pdf to tiff activeX
or
pdf to jpg "command line"
pdf to tiff "command line"
I find a lot of tools mentioned.
But I trust that you have done the same and tried to use a variety of these.

Not that I recommend it, but if you REALLY want to do a PDF to TXT conversion, after testing a number of tools, I finally found one that works 'reasonably' well. It is PTConverter.

I have a client that needs me to do a SOAP transfer to them and they MUST have the data in a formatted TEXT manner. I looked around for something that I could run from VFP using a Command String and, after testing a few, found that this one worked OK (note - OK, but not GREAT).

So for this one client I create a VFP Report, print it to a PDF (using BullZip) and then, via a Command line call with ShellExecute(), convert that to a formatted TEXT document with PTConverter.

Note the resultant formatted text needs some 'manipulation' sometimes when PTConverter, for some reason, can't handle certain character combinations.

But FILETOSTR() followed by a few necessary STRTRAN()'s resolved the problems for the client's SOAP transmission.
I'd guess that in your situation you'd want to follow that process with a STRTOFILE() to get the results back to a file.

Hopefully some that info will help you in some way.

Good Luck,
JRB-Bldr


 
Hi Mike

Thank you for getting back to me so quickly.

Using screen shots won't do it, as the service sheets are double-sided A4 documents.

I will take a look at DeskUNPDF tho. Saving as a different format using Word automation is one approach that I haven't looked at yet. Even if application speed is an issue, the time taken to open and close Word with a few file instructions inbetween will still beat feeding the pages into the fax machine.

I will let you know how I get on. Have a good weekend!

Thanks

Karen

 
Hi JRB-Bldr

I have been through hours and hours of internet searches, PDF to TIFF command line, PDF converter etc... but I don't think I've come across PTConverter yet, so I will go and check it out.

Thanks again for your help.

Karen
 
jrbbldr,

a bit OT, just as a side track, I wonder why you need to print data to a pdf and convert that to text besides the STRTRAN finally needed, wouldn't it be better to go a more direct route, since the frx surely is based on some data you could also print to txt or even use TextMerge or TEXT..ENDTEXT to get formatted Text and then STRCONV() to get it into the needed codepage or Unicode or UTF-8, whatever is needed for the Soap messages.

Bye, Olaf.
 
I wonder why you need to print data to a pdf and convert that to text besides the STRTRAN finally needed, wouldn't it be better to go a more direct route, since the frx surely is based on some data you could also print to txt

Olaf - The reason that I had to go VFP Report -> PDF -> TXT was that the VFP Report form had the data laid out in a very specific manner.

We were already emailing the PDF directly to the client as an attachment so we wanted the SOAP delivery to a web-displayer of the data to most closely match the data layout that the client was already receiving directly.

Any of the direct VFP Report to TXT methods that I tried failed to retain anything close to the layout of the VFP Report.

Admittedly this was a round-about method of getting the job done, but considering the goals and the results of the tools tested, it was the only way that worked reasonably well.

KarenLloyd - Good Luck,
JRB-Bldr

 
I see and can understand that if the PDF output came first I may have gone that route, too.

I don't know the details and how close PTConverter matches the layout. I think if being able to go from the root, the data, TEXT ENDTEXT could achive the same or better, I can also believe a frx to txt print can result in a totally different result, but you're talking of ascii text here, aren't you? Without multiple fonts, without bold or other text formatting, no embedded images. That is totally possible todo with TEXT ENDTEXT, of course this introduces the problem of maintaing both an frx and a TEXT ENDTEXT passage/template and as you need both I surely see the reusability is better with such a tool.

Bye, Olaf.
 
Hiya

Thank you all for your replies and suggestions.

After trying each of the solutions above I also tried a few more including Convert PDF to Image and PDFtoTIFF, for Command Line conversion. Then I spent a bit more time with Ghostscript and managed to produce TIFF files from PDFs using the following syntax (I'll just put the base command line in here in case some poor soul should ever need it for something similar...)

Code:
gswin32c -q -sDEVICE=tiffg4 -sPAPERSIZE=a4 -sOutputFile=output.tif -dNOPAUSE -dBATCH -f input.pdf

Anyway, all of the above can be used with command line to produce tiff files or varying quality, with Ghostscript being the lowest, partly due to my lack of formatting instructions.

The original document is a double-sided vehicle service sheet, which is in a form layout, with grid lines, various sized text headings, ticks, initials and handwritten remarks etc.

But, by the time it has been rendered and faxed via Outlook, it arrives as the same illegible low quality image, regardless of the quality of the original TIFF file.

A tad frustrating... So, as much as I hate to give up on anything, I will now just rule these documents out of the Outlook faxing process and change my "everything is possible" approach to "anything is triable", and then set a new time limit. =D

Have a great weekend!

Best wishes

Karen


 
I'm sorry to hear that things are not coming together for your project.

If these documents are in electronic form and are in a readable manner, you might want to try to send them through an on-line FAX service and skip the Outlook involvement all together.

Good Luck,
JRB-Bldr


 
Hi JRB-Bldr

Thank you again for your patience and support. It may well be that the minority who needed faxed Service Sheets can be handled via a fax printer instead. But sometimes the people I'm working for can leave these kind of details til for too late. Eventually I might hear "oh, well it's only one company wants them by fax" or "they've all got email now so it doesn't matter".

The other thing that I didn't mention, is that faxing one tiff version of a service sheet can take up to ten minutes. Go figure...?

Still, I found some amazing solutions while looking, but not everyone can afford to speculate to accumulate. (Including me!)

Cheers anyway

Karen

By the way - although I didn't get the exact answer that I wanted, that is nothing to do with your advice, Gurus. So I send you all a star for your continued brilliance and support. Thank you.
 
I might hear "oh, well it's only one company wants them by fax" or "they've all got email now so it doesn't matter".

That is precisely the justification I used WAY BACK WHEN to get my client to abandon sending automated FAX's altogether and transition totally over to emails with PDF attachments or email with an HTML body.

Now that client has also added HTTP Post of the info as an alternative delivery method to the recipient's web-displayer (they often market themselves as info "aggregator's" - what a laugh) so that the recipient can access the info on the web.

It has worked about 98% of the time, but the problems have generally been on the recipient service's end and they were a pain to set up for each different recipient service since they all have their own unique requirements - don't try to tell me about it being 'standardized'!

Good Luck,
JRB-Bldr
 
I may be off topic... Why not ftp the file and email the link ? (All this can be done through VFP)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top