Howto print pdf document (PurePDF)

Just starting out? Need help? Post your questions and find answers here.
karu
Enthusiast
Enthusiast
Posts: 255
Joined: Fri Jan 13, 2006 12:14 am

Howto print pdf document (PurePDF)

Post by karu »

Hi, does anyone have idea how to print (created with PurePDF) pdf file from purebasic code? Acrobat reader is not solution?
swan
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 03, 2004 9:04 am
Location: Sydney Australia
Contact:

Re: Howto print pdf document (PurePDF)

Post 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.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Howto print pdf document (PurePDF)

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Falko
Enthusiast
Enthusiast
Posts: 271
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

Re: Howto print pdf document (PurePDF)

Post by Falko »

www.falko-pure.de
Win11 Pro 64-Bit, PB_6.11b1
swan
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 03, 2004 9:04 am
Location: Sydney Australia
Contact:

Re: Howto print pdf document (PurePDF)

Post 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).
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Howto print pdf document (PurePDF)

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
morosh
Enthusiast
Enthusiast
Posts: 329
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

Re: Howto print pdf document (PurePDF)

Post by morosh »

PDFPrint Command Line v2.0, from www.verypdf.com, can do the job, but it's not free
PureBasic: Surprisingly simple, diabolically powerful
swan
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 03, 2004 9:04 am
Location: Sydney Australia
Contact:

Re: Howto print pdf document (PurePDF)

Post by swan »

US$199 to print only. Not cheap. I thought QuickPDFLibrary was expensive but it can do much more than just print.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Howto print pdf document (PurePDF)

Post by IdeasVacuum »

IdeasVacuum
If it sounds simple, you have not grasped the complexity.
swan
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 03, 2004 9:04 am
Location: Sydney Australia
Contact:

Re: Howto print pdf document (PurePDF)

Post 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.
VoSs2o0o
User
User
Posts: 24
Joined: Fri Aug 06, 2010 11:46 pm

Re: Howto print pdf document (PurePDF)

Post by VoSs2o0o »

Foxit Reader, its free and small

Code: Select all

/p
swan
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 03, 2004 9:04 am
Location: Sydney Australia
Contact:

Re: Howto print pdf document (PurePDF)

Post 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.
TerryHough
Enthusiast
Enthusiast
Posts: 781
Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:

Re: Howto print pdf document (PurePDF)

Post 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\")
swan
Enthusiast
Enthusiast
Posts: 225
Joined: Sat Jul 03, 2004 9:04 am
Location: Sydney Australia
Contact:

Re: Howto print pdf document (PurePDF)

Post by swan »

Thanx, but the problem is both/either have to be installed on the host machine, hence the need for a standalone solution.
Wood51
New User
New User
Posts: 7
Joined: Sat May 12, 2012 11:21 am

Howto print pdf document (PurePDF)

Post 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 ?
Post Reply