Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > PDF

Notices

Reply
 
Thread Tools Search this Thread
Old 03-13-2018, 09:40 PM   #1531
MarjaE
Addict
MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.MarjaE ought to be getting tired of karma fortunes by now.
 
Posts: 345
Karma: 1548692
Join Date: Jun 2015
Device: Iriver Story HD and Amazon Kindle DX
Sorry.
Attached Files
File Type: pdf cyrillic2 - Converted.pdf (3.54 MB, 18 views)
MarjaE is offline   Reply With Quote
Advert
Old 03-17-2018, 03:49 PM   #1532
xilopaint
Junior Member
xilopaint began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2018
Device: none
Hello willus!

I have been trying to follow the instructions to build k2pdfopt in macOS, but I'm getting these errors:

Quote:
$ gcc -Ofast -Wall -m64 -o k2pdfopt.o -c k2pdfopt.cg
clang: error: no such file or directory: 'k2pdfopt.cg'
clang: error: no input files
My intention is trying to build a lightweight version of k2pdfopt for my Alfred workflow. I need only four command line options: "-as", "-mode copy", "-dpi" and "-o".

Last edited by xilopaint; 03-17-2018 at 03:52 PM.
xilopaint is offline   Reply With Quote
Old 03-18-2018, 02:25 PM   #1533
willus
Fuzzball, the purple cat
willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.
 
willus's Avatar
 
Posts: 974
Karma: 7562459
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by xilopaint View Post
Hello willus!

I have been trying to follow the instructions to build k2pdfopt in macOS, but I'm getting these errors:



My intention is trying to build a lightweight version of k2pdfopt for my Alfred workflow. I need only four command line options: "-as", "-mode copy", "-dpi" and "-o".
What instructions are you trying to follow? The instructions I include with the source code say this:
Code:
Build Steps on OS/X (64-bit, gcc 6.2.0, compiled on OSX 10.12 Sierra)
----------------------------------------------------------------------
1. gcc -Ofast -Wall -m64 -o k2pdfopt.o -c k2pdfopt.c

2. g++ -Ofast -m64 -o k2pdfopt k2pdfopt.o -static-libgcc -static-libstdc++ -lk2pdfopt -lwillus -lgocr -ltesseract -lleptonica -ldjvu -lmupdf -lfreetype -ljbig2 -ljpeglib -lopenjpeg -lpng -lzlib -lpthread
The trick is going to be getting all of the libraries to compile. Honestly, I don't think this is worth your effort--you would have to substantially modify the code to really strip out everything but those options. Why not just use the OSX binary? Is the extra size really a problem?
willus is offline   Reply With Quote
Old 03-18-2018, 08:47 PM   #1534
xilopaint
Junior Member
xilopaint began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2018
Device: none
Quote:
Originally Posted by willus View Post
What instructions are you trying to follow? The instructions I include with the source code say this:
Code:
Build Steps on OS/X (64-bit, gcc 6.2.0, compiled on OSX 10.12 Sierra)
----------------------------------------------------------------------
1. gcc -Ofast -Wall -m64 -o k2pdfopt.o -c k2pdfopt.c

2. g++ -Ofast -m64 -o k2pdfopt k2pdfopt.o -static-libgcc -static-libstdc++ -lk2pdfopt -lwillus -lgocr -ltesseract -lleptonica -ldjvu -lmupdf -lfreetype -ljbig2 -ljpeglib -lopenjpeg -lpng -lzlib -lpthread
The trick is going to be getting all of the libraries to compile. Honestly, I don't think this is worth your effort--you would have to substantially modify the code to really strip out everything but those options. Why not just use the OSX binary? Is the extra size really a problem?
Oh, sorry! I didn't realise I had included a letter "g" at the end of the command. Now I'm getting other error:

Quote:
$ gcc -Ofast -Wall -m64 -o k2pdfopt.o -c k2pdfopt.c
k2pdfopt.c:76:10: fatal error: 'k2pdfopt.h' file not found
#include <k2pdfopt.h>
^~~~~~~~~~~~
1 error generated.
k2pdfopt.h is not in the same path of k2pdfopt.c.

Last edited by xilopaint; 03-18-2018 at 09:03 PM.
xilopaint is offline   Reply With Quote
Old 03-27-2018, 05:59 PM   #1535
pgodz
Junior Member
pgodz began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Mar 2018
Device: Kindle Paperwhite
Hey! I'm trying to preserve the original layout but bitmap the image and the text. Is it possible to disable scaling?

Thanks!
pgodz is offline   Reply With Quote
Old 03-28-2018, 08:44 AM   #1536
willus
Fuzzball, the purple cat
willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.
 
willus's Avatar
 
Posts: 974
Karma: 7562459
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by pgodz View Post
Hey! I'm trying to preserve the original layout but bitmap the image and the text. Is it possible to disable scaling?

Thanks!
This is exactly what "-mode copy" is for. Set the output page dpi with -odpi. E.g.
k2pdfopt -mode copy -odpi 300 myfile.pdf
...will bitmap each page at 300 dpi and store in the output file.
willus is offline   Reply With Quote
Old Yesterday, 08:07 PM   #1537
Ramo
Junior Member
Ramo began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Mar 2018
Device: Kobo TouchC
How to discard the hidden text?

My Kobo Touch C is having problems reading a very big pdf file - 1466 pages - that also has hidden text. I think that just removing the hidden text would solve my problem. I was able to do this once, but only with a subset of the file that I set u to test it but now can not repeat the results.

Could some one help me show me the options to mantaing everything - size, dpi, color etc. - but just get rid of the hidden text?
Ramo is offline   Reply With Quote
Old Yesterday, 11:08 PM   #1538
willus
Fuzzball, the purple cat
willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.
 
willus's Avatar
 
Posts: 974
Karma: 7562459
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by Ramo View Post
My Kobo Touch C is having problems reading a very big pdf file - 1466 pages - that also has hidden text. I think that just removing the hidden text would solve my problem. I was able to do this once, but only with a subset of the file that I set u to test it but now can not repeat the results.

Could some one help me show me the options to mantaing everything - size, dpi, color etc. - but just get rid of the hidden text?
There's not a simple option to do this--to just strip hidden text--with k2pdfopt. What you have to do is use -mode copy, but you'll want to set your DPI and color depth to try and match what you have now. You can see information about how the PDF you have is encoded with the -i option, e.g.

k2pdfopt -i myfile.pdf

You can then select options to match, e.g.

k2pdfopt -mode copy -odpi 200 -c -g 1 -sh- -cmax 1 -ocr- myfile.pdf

This copies the dimensions, sets bitmap DPI to 200, turn on color output, sets gamma to 1 (no change), turns off sharpening, turns off contrast adjust, and turns off OCR (no hidden layer). You can try just a few pages of conversion by adding: -p 1-10 (convert the first 10 pages only).
willus is offline   Reply With Quote
Old Today, 10:19 AM   #1539
Ramo
Junior Member
Ramo began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Mar 2018
Device: Kobo TouchC
Quote:
Originally Posted by willus View Post
k2pdfopt -mode copy -odpi 200 -c -g 1 -sh- -cmax 1 -ocr- myfile.pdf

This copies the dimensions, sets bitmap DPI to 200, turn on color output, sets gamma to 1 (no change), turns off sharpening, turns off contrast adjust, and turns off OCR (no hidden layer). You can try just a few pages of conversion by adding: -p 1-10 (convert the first 10 pages only).
Thank You!

It worked!

I don't know if you are still developing the the software, although I can see that you are very active in the forum, but maybe this is a feature worth implementing: deleten the hidden text layer.

In my case the Kobo just couldnt cope with the hidden text. Whenever I moved th image to reposition I would get the image of the hidden text instead of the actual image layer. It would freeze there and the only way I was able to circunvent it was to put the device to sleep, when waken back it would show me the image like nothing had happend...

Anyways great piece of software! Just the learning curve that is a bit steep.
Ramo is offline   Reply With Quote
Old Today, 11:17 AM   #1540
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 10,928
Karma: 12294882
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Removing the text layer has its downsides. Search for text will no longer work. All you have is a set of images.
DaleDe is offline   Reply With Quote
Reply

Tags
ebook apps, k5 tools, kindle tools, kindle touch, tools

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Viewing PDFs with another font Font PocketBook 4 11-12-2010 08:27 AM
Viewing Textbook PDFs... NJReader enTourage Archive 4 08-17-2010 05:17 PM
PRS-600 Restart bug while viewing PDFs? conundrum Sony Reader 2 03-04-2010 08:46 PM
More on viewing pdfs dso371 Bookeen 8 03-11-2008 07:15 PM
Viewing Untagged PDFs on Palm T|X Eroica Reading and Management 3 12-10-2007 01:44 PM


All times are GMT -4. The time now is 12:47 PM.


MobileRead.com is a privately owned, operated and funded community.