LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 12-08-2012, 05:32 AM   #1
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
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: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

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
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
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: 731

Original Poster
Rep: Reputation: 158Reputation: 158
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
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
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: 731

Original Poster
Rep: Reputation: 158Reputation: 158
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
 
Old 07-12-2016, 04:15 AM   #7
sicsic
LQ Newbie
 
Registered: Jul 2016
Posts: 1

Rep: Reputation: Disabled
Still there

This issue is still present in the latest CUPS-PDF but you can fix it by installing patching it yourself or getting a deb package from here:
https://launchpadlibrarian.net/15378..._support.patch

and
https://launchpad.net/~jethrogb/+archive/ubuntu/ppa
 
Old 09-07-2018, 10:14 PM   #8
ramack
LQ Newbie
 
Registered: Jun 2006
Location: Colorado, USA
Distribution: Debian
Posts: 13

Rep: Reputation: 1
For me, ps2pdf had been working, but has recently stopped producing selectable text.

Debian AMD64 Stretch

Last edited by ramack; 09-07-2018 at 10:15 PM.
 
  


Reply



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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:14 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration