Page 1 of 2

Howto print pdf document (PurePDF)

Posted: Wed Sep 19, 2012 6:44 pm
by karu
Hi, does anyone have idea how to print (created with PurePDF) pdf file from purebasic code? Acrobat reader is not solution?

Re: Howto print pdf document (PurePDF)

Posted: Thu Sep 20, 2012 12:30 am
by swan
There are a few dll solutions. The one I use is QuickPdfLibrary, not cheap though. I twas free once but bought out by Debenu and stuck a stupid price on it. I too only use it for printing so not great value.

Re: Howto print pdf document (PurePDF)

Posted: Thu Sep 20, 2012 12:34 am
by IdeasVacuum
I think you have to use an app (like Adobe Reader) that can open a pdf file. You can use RunProgram() and just give the path + name of the pdf file you just created - that will open the file with whatever app the PC has avaiable to open pdfs. It might be the case that Reader has a command line argument that would just print the file without displaying first, but I have not seen that.

An alternative would be to build your own print file in a similar way to how you built the pdf, using the Print_Lib. The print lib can handle some graphics commands if required but it is not as comprhensive as the pdf lib. Another alternative - you could draw the entire document on an image using the 2D drawing commands - with that route, the print and the pdf file can be of the image, so they would be identical and that is desirable.

Re: Howto print pdf document (PurePDF)

Posted: Thu Sep 20, 2012 3:30 pm
by Falko

Re: Howto print pdf document (PurePDF)

Posted: Fri Sep 21, 2012 12:16 am
by swan
Acro reader not a solution already stated. On a distributed product U simply can't guarantee it to be available. I had the same problem to solve a few years back thats why I went for the dll solution (albeit not cheap).

Re: Howto print pdf document (PurePDF)

Posted: Fri Sep 21, 2012 12:40 am
by IdeasVacuum
.....As a compromise, the app could have a link to the Adobe Reader download. However, if it is suitable for the data, I think the idea of creating an image that will both print and be saved as a pdf would be the best solution.

Re: Howto print pdf document (PurePDF)

Posted: Fri Sep 21, 2012 2:43 pm
by morosh
PDFPrint Command Line v2.0, from www.verypdf.com, can do the job, but it's not free

Re: Howto print pdf document (PurePDF)

Posted: Fri Sep 21, 2012 11:38 pm
by swan
US$199 to print only. Not cheap. I thought QuickPDFLibrary was expensive but it can do much more than just print.

Re: Howto print pdf document (PurePDF)

Posted: Sat Sep 22, 2012 2:19 am
by IdeasVacuum

Re: Howto print pdf document (PurePDF)

Posted: Sun Sep 23, 2012 12:31 am
by swan
That looks interesting.
If I'm reading it right though it's a java commandline (.jar) to print, so java has to be installed on the host machine. In a way - out of the frying-pan into the fire.

Re: Howto print pdf document (PurePDF)

Posted: Wed Sep 26, 2012 4:43 pm
by VoSs2o0o
Foxit Reader, its free and small

Code: Select all

/p

Re: Howto print pdf document (PurePDF)

Posted: Wed Sep 26, 2012 11:35 pm
by swan
Foxit Reader is an application. Doesn't seem to have commandline or library capabilities (or does it ?). If so it's simply a Acro Reader replacement, which is free anyway.

Re: Howto print pdf document (PurePDF)

Posted: Thu Sep 27, 2012 4:07 am
by TerryHough
Foxit Reader

To print to the default printer...

Code: Select all

RunProgram("C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe", "/p SomeFile.pdf","C:\FolderName\")
To print to a desired printer...

Code: Select all

RunProgram("C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe", "/t SomeFile.pdf PrinterName","C:\FolderName\")
Acrobat Reader
Caution: Adobe says these are unsupported commands, but they have existed for many versions. About Vs 8 Acrobat Reader stopped closing when called this way.

To print to the default printer... After printing Acrobat Reader will remain active and you will need to find a way to close it.

Code: Select all

RunProgram("C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe", "/p SomeFile.pdf","C:\FolderName\")
To print to a desired printer... After printing Acrobat Reader will remain active and you will need to find a way to close it.

Code: Select all

RunProgram("C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe", "/t SomeFile.pdf " + Chr(34)+ PrinterName + Chr(34),"C:\FolderName\")

Re: Howto print pdf document (PurePDF)

Posted: Thu Sep 27, 2012 4:16 am
by swan
Thanx, but the problem is both/either have to be installed on the host machine, hence the need for a standalone solution.

Howto print pdf document (PurePDF)

Posted: Thu Sep 27, 2012 8:44 am
by Wood51
Hello , first excuse me for my bad english .
In your code you "draw" the pdf , why not draw an image, print image and create the pdf with this image ?
Perhaps ?