LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 12-08-2012, 05:32 AM   #1
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 477

Rep: Reputation: 100Reputation: 100
Cannot copy text from pdfs created with cups-pdf


I have this issue with pdfs that are printed via the cups-pdf printer:

The output looks ok - all text and graphics is visible.

BUT if i try to mark and copy text from the pdf, only gibberish stuff is copied in the clipboard.
It seems that everything is in fact a background picture with some random characters overlaid here and there.

Now this is probably caused by the fact that the printing goes through a ps filter first.
The driver associated with the cups-pdf printer is a ps-based one. There is a driver named just "PDF" but that outputs empty pages.
I use Debian Testing 32-bit - tried cups/cups-pdf standart testing version, unstable and experimental versions.

My question is:

Is there a way to print as pdf under Linux and embed the fonts too? PDF printers under Windows that use ghostscript seem to do just fine.

I mean a generic printer, not the pdf generators found in specific apps.

Last edited by gradinaruvasile; 12-08-2012 at 05:35 AM.
 
Old 12-09-2012, 10:29 AM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,754

Rep: Reputation: Disabled
printed this page to pdf file via FF

(cairo graphics-, pdf-1.5)

selected text

pasted below:

{Cannot copy text from pdfs created with cups-pdf
I have this issue with pdfs that are printed via the cups-pdf
printer:
The output looks ok - all text and graphics is visible.
BUT if i try to mark and copy text from the pdf, only gibberish
stuff is copied in the clipboard.
It seems that everything is in fact a background picture with
some random characters overlaid here and there.
}

No problems


postscript is a drawing language : the same method for ps file does not work.

yours is a pdf-1.4 file.
 
Old 12-09-2012, 03:41 PM   #3
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,737

Rep: Reputation: 184Reputation: 184
You might try printing to ps then converting to pdf.
Install Ghostscript and print to file ps or pdf.

Use ghostscript itself
http://vis.lbl.gov/NERSC/Software/gh...w/docs/Use.htm
http://www.ghostscript.com/Documentation.html
http://www.tldp.org/HOWTO/Printing-H...ostscript.html

Ps2pdf
http://vis.lbl.gov/NERSC/Software/gh...ocs/Ps2pdf.htm
Pdf2ps
http://stefaanlippens.net/pdf2ps_vs_pdftops

Examples
http://www.productionmonkeys.net/gui...cript/examples
http://www.novell.com/documentation/...l/ch06s06.html
http://www.novell.com/documentation/...l/ch06s07.html

There is ggv for a front end.
http://linux.about.com/cs/linux101/g/ggv.htm

Looks like you are printing the file as an image.
 
Old 12-11-2012, 11:26 AM   #4
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 477

Original Poster
Rep: Reputation: 100Reputation: 100
Quote:
Originally Posted by amani View Post
printed this page to pdf file via FF

(cairo graphics-, pdf-1.5)

selected text

pasted below:

{Cannot copy text from pdfs created with cups-pdf
I have this issue with pdfs that are printed via the cups-pdf
printer:
The output looks ok - all text and graphics is visible.
BUT if i try to mark and copy text from the pdf, only gibberish
stuff is copied in the clipboard.
It seems that everything is in fact a background picture with
some random characters overlaid here and there.
}

No problems


postscript is a drawing language : the same method for ps file does not work.

yours is a pdf-1.4 file.
Did you print via cups (ctrl-p then select "Generic cups-pdf printer" from printer list)? I know that Firefox has extensions that do this, but this isnt the issue here.

The question is that can cups create pdfs that have embedded fonts (the idea is to have means to create pdf files that works from any printing-capable programs and embeds text)?

I tried saving as ps, then ps2pdf and i got exactly the same result as with cups-pdf. BTW cups-pdf depends on ghostscript so i assume it does exactly this.
 
Old 12-11-2012, 01:29 PM   #5
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,737

Rep: Reputation: 184Reputation: 184
Quote:
Is there a way to print as pdf under Linux and embed the fonts too?
Yes I do it all the time.
(File)-(print)-(print to file.pdf) using firefox or midori.
Export as pdf from libre office or abiword.
ps2pdf, a2pdf, text2pdf, wkhtmltopdf
I don't have cups-pdf installed.

This web page will print to file.pdf from your browsers "print to file" and the .pdf has text in it. From BSD and Linux. It can also be printed to .ps or vsg. Vector graphics will be an image.
Libre office will print to file, thunderbird will etc.

Code:
pacman -Ss ghost
extra/ghostscript 9.06-1 [installed]
    An interpreter for the PostScript language
extra/gsfonts 1.0.7pre44-3 [installed]
    Standard Ghostscript Type1 fonts from URW
Code:
pacman -Ss cups-pdf
extra/cups-pdf 2.6.1-1
    PDF printer for cups
I just printed this page to file.ps from a browser. Then ran
Code:
ps2pdf file.ps output.pdf
output.pdf has embedded text.

I printed this web page to file.pdf
file.pdf has embedded text.

I then printed this web page to file.ps then ran
Code:
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -sOutputFile=output.pdf file.ps
ouput.pdf has embedded fonts.

You can also use
Code:
html2pdf http://www.linuxquestions.org output.pdf
 
Old 12-11-2012, 02:41 PM   #6
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 477

Original Poster
Rep: Reputation: 100Reputation: 100
So. I did exactly the same and every pdf i print/convert is EXACTLY the same as i get with cups-pdf. Look at the pdf attached to the first post. All look exactly the same, be it i print with cups/pdf, or if i save as ps and convert it to pdf.

Adobe Reader even marks all the text areas, but if i copy-paste it, i get unreadable characters. Evince and other readers mark only a few characters here and there, but if i copy-paste them, i get only a few characters (not the ones that are marked are pasted).

I use Debian Testing. Currently i have:

Quote:
# apt-cache policy ghostscript
ghostscript:
Installed: 9.05~dfsg-6.3
# apt-cache policy gsfonts
gsfonts:
Installed: 1:8.11+urwcyr1.0.7~pre44-4.2
# apt-cache policy gsfonts-other
gsfonts-other:
Installed: 6.0-4
# apt-cache policy cups-pdf
cups-pdf:
Installed: 2.6.1-7
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED]Combining multiple PDFs into one PDF? tommyttt Linux - Software 2 05-15-2012 05:43 PM
What would cause text-to-file and PDF to file printers on a cups system to stop? slinx Linux - Software 2 12-02-2008 09:32 AM
A pdf Viewer to copy a text in German? xpucto Linux - Software 6 07-17-2006 09:00 AM
LXer: Manipulating PDFs with the PDF Toolkit LXer Syndicated Linux News 0 04-27-2006 12:54 PM
printing PDFs with CUPS sfrdll Linux - Software 0 07-24-2004 04:35 PM


All times are GMT -5. The time now is 08:09 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration