Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print to PDF
Message
From
13/07/2011 10:59:34
 
General information
Forum:
ASP.NET
Category:
Pictures and Image processing
Title:
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01518063
Message ID:
01518084
Views:
44
>>>Hi All, I have a print screen class which accepts a parameter of type "Form" and then does what it says on the tin. One of my users has asked me if it's possible to print it to a pdf - no problem thinks I - I installed a print driver called CutePDF and set that as the default printer - print to pdf - then set the default printer back to what it was - THE GOTCHA - The print driver pops up a "SaveAsDialog" which I have no control over - I want to save the pdf in a specific place depending on what is on the printed form. I've tried Directory.SetCurrentFolder(myfolder) before calling the Print() method but it is ignored - anyone know of a product that will fit the bill ( client will buy if neccessary ) ?
>>
>>
>>Pete,
>>
>>Have only used this with a dll in foxpro, but there is a .net interface
>>
>>http://www.bullzip.com/products/pdf/info.php
>>
>>Look here for API .Net interface http://www.biopdf.com/guide/
>>
>>There's also a command line interface http://www.biopdf.com/guide/exe_interface.php
>
>Gregory - can you post some sample foxpro code showing how you use this product in VFP?


Chris,

You first have to print to a postscript printer (report ...... to file xxx.txt)


The file you printed to (here xxx.txt) is a postscript file

You then feed that file to the dll
see Re: GhostScript DLL in VFP -VB translation ? Thread #658592 Message #658748


ps: you can print to several postscript files and pass their names to the gs32dll (gsapi_init_with_args). You then have one big pdf

In the example, that would mean adding more files to laArgs[]

The args I am usng are
ps2pdf
-I??\gs\gs8.60\lib;??\gs\fonts   ( where ?? is C:\program files)
-sDEVICE=pdfwrite
-sPAPERSIZE=a4
-r300
-dPDFSETTINGS=/prepress
-dNOPAUSE
-dBATCH
-dNOSAFER
-dAutoRotatePages=/PageByPage
-dQUIET
-sOutputFile=    (+ the path of the outputfile)
-f
postscriptfile1
postscriptfile2
...
postscriptfileN
pps: You can also concatenate pdf files

The args are the same as above up to and including sOutputFile=
Then you add the different pdf fles



Disclaimer: I'm still using version 3.0 which is from 2007 I think. Works also on 64 bit.
I am having problems with their version 7. But I have not had time to investigate - I keep using version 3.0 (which uses ghostscript 8.60)
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform