Read contents of PDF file
Hi guys,
I am searching for a API which will help me to print pdf file.Is there any way? or is there any API to read content of PDF file & store it in buffer?? Please help me guys. |
What language are you using? From the word "buffer", C/C++ suggests itself to me... In which case you probably want to be looking at using CUPS API
|
You can use pdf2txt utility to and store the content in the textfile and read from that.
|
Quote:
I am using unix & I want to write a script which will print pdf file.Otherwise read the contents from pdf file stored in textfile coz printing with text file is working properly. Is there any way?I searched CUPS Doc ,but can't got any thing.Do U know ??? Regards, Sumit |
Quote:
I am writing a script so this command can't help me .Do you know any cups API for this?? Thanks regards, Sumit |
What do you want to do Sumit? Use a (shell?) script to print a PDF via CUPS?
If so, the words API and buffer are not applicable because shell scripts:
|
Quote:
Do you have any idea about CUPs API for reading PDF file data . Thanks Regards, Sumit |
Quote:
Do you want to use a language like C/C++ ? Or do you want to use a language like bash (ie. write a shell script) ? |
Quote:
Its a c++ lauguage. thanks regards Sumit |
Quote:
|
In that case, I think you should look at links like these:
http://www.cups.org/documentation.php/api-overview.html http://www.cups.org/documentation.php/api-cups.html http://www.cups.org/doc-1.1/spm.html#3_2_2 *** this one especially, it has example code for printing a file: Code:
#include <cups/cups.h> Hope this helps, |
Quote:
Thanks for reply its really appreciated u r investing time for problem ... I have already searched these files ,but m not getting what i wanted,Do you know about pdftops filter how it is used ? any example? Thanks Regards, Sumit |
Quote:
Do you know how to use this utility in c++?I want to write a code in CUPS. I am able to convert file by using command line. Do you know anything about pdftops filter? Thanks regards, Sumit |
When you talk about 'pdf2txt' and 'pdftops', you're talking about bash scripts NOT C++. If you want to craft a solution with bash, then that may well be easier, but it is definitely not C++.
Anyway, I have no printers on my system so I have no idea if this works (it compiles, and prints the correct output for me; "No printers found.") Try it and see: Code:
#include <stdio.h> Code:
gcc printer.c -o printer `cups-config --cflags` `cups-config --libs` -Wall |
Quote:
hi buddy, Thanks for reply I have already tried this code but it didn't work.it prints Nothing ,other case is ,When i give print command from command line to print pdf file ,It prints but the content is "Memory should be greater than 128Mb ". Is there any way????what is problem ??The code is working fine for text and ps file. Thanks & regards, Sumit |
API for printing error
hi guys ,
i would like to know whether there is any API for displaying error in printing file.Its like printer is out of paper,tray is open .I am working on Linux machine,cups version is 1.4 . plz help me guys. regards, sumit |
Try to sort one problem at a time. You keep asking for different APIs, different tools, different languages. You say you can print from the command line with .txt and .ps files, but not .pdf files? Work out how to print .pdf files before you start asking about error APIs. If you can print .ps files, why not try:
Code:
$> pdftops myFile.pdf myFile.ps Code:
$> lpr myFile.ps |
Quote:
If u can see my previous post might notice that I tried this things and after that M getting error about memory ,I thinks that problem is related to printers own memory.... |
All times are GMT -5. The time now is 06:37 AM. |