Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > PDF

Notices

Reply
 
Thread Tools Search this Thread
Old 04-30-2019, 09:00 AM   #1696
Sciamano
Member
Sciamano began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Mar 2011
Device: Kindle 3
EDIT: I downloaded the file again and now it works. It must have been a temporary network problem during the downloading of the file. Scratch the question below.

ORIGINAL MESSAGE:

Hello!
I have installed wine v4.00 on my Linux Mint 19 installation and tried launching k2pdfopt v2.51a 32-bit.
It won't run, instead a popup error message saying "Error - Access denied" will show up, immediately followed by a series of popups saying "Error - File not found".
Version 2.42 works, though.
Any insights? Should I stick with v2.42?
Thanks

Last edited by Sciamano; 04-30-2019 at 10:29 AM.
Sciamano is offline   Reply With Quote
Old 06-27-2019, 01:48 AM   #1697
MarjaE
Guru
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: 924
Karma: 53902736
Join Date: Jun 2015
Device: multiple
"Unexpected end of file" and "Invalid data type"

Hi,

I've been using k2 to pre-process my pdfs. I've also been using Calibre to organize them, track important topics, etc.

My pdf software on my computer often shows the wrong titles for these files, which makes it harder to keep track of things. I've tried using Calibre to copy its metadata to its copies of these book files, to get my pdf software to show the right titles.

But the import sometimes fails with k2 files, with either "unexpected end of file," or "invalid data type." I've tried creating a new copy from one of the originals, importing it into Calibre, and copying its metadata, and again, the same error.

Do you have any idea why some k2 pdfs might do this?

Thanks
MarjaE is offline   Reply With Quote
Advert
Old 06-28-2019, 10:28 AM   #1698
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: 1,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by MarjaE View Post
Hi,

I've been using k2 to pre-process my pdfs. I've also been using Calibre to organize them, track important topics, etc.

My pdf software on my computer often shows the wrong titles for these files, which makes it harder to keep track of things. I've tried using Calibre to copy its metadata to its copies of these book files, to get my pdf software to show the right titles.

But the import sometimes fails with k2 files, with either "unexpected end of file," or "invalid data type." I've tried creating a new copy from one of the originals, importing it into Calibre, and copying its metadata, and again, the same error.

Do you have any idea why some k2 pdfs might do this?

Thanks
@Marja--we've been through this before. You complain about the behavior of k2pdfopt but offer me no examples of source files that cause the problem. I cannot help you if you do not attach some examples. Please attach a file, that when you process it with k2pdfopt, results in "unexpected end of file" or "invalid data type". Please indicate the exact command-line options you are using to process the file, and also let me know what version of k2pdfopt you are using.
willus is offline   Reply With Quote
Old 06-30-2019, 06:38 AM   #1699
MarjaE
Guru
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: 924
Karma: 53902736
Join Date: Jun 2015
Device: multiple
Yes, we have been through this before. Unfortunately, the files I was keeping the best notes on are ones I'd bought and can't share, as before. I've been up all night trying to track down which of the others glitched out at the end.

But I am using -ui -mode copy -dev dx

Also -dev ? gives an error: "device profile '?' not known"

Is there a list of available profiles?

Thanks.
MarjaE is offline   Reply With Quote
Old 06-30-2019, 05:12 PM   #1700
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: 1,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by MarjaE View Post
Yes, we have been through this before. Unfortunately, the files I was keeping the best notes on are ones I'd bought and can't share, as before. I've been up all night trying to track down which of the others glitched out at the end.

But I am using -ui -mode copy -dev dx

Also -dev ? gives an error: "device profile '?' not known"

Is there a list of available profiles?

Thanks.
In linux or OSX, you have to put the ? in quotation marks:

k2pdfopt -dev "?"


(See response below.)


I sent you a PM.


Code:
Available devices:
    Kindle 1-5 (alias k2): 560 x 735, 167 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kindle DX (alias dx): 800 x 1180, 167 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,0,0

    Kindle Paperwhite (alias kpw): 658 x 889, 212 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kindle Paperwhite 2 (alias kp2): 718 x 965, 212 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kindle Paperwhite 3 (alias kp3): 1016 x 1364, 300 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kindle Voyage/PW3+/Oasis (alias kv): 1016 x 1364, 300 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kindle Oasis 2 (alias ko2): 1200 x 1583, 300 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Pocketbook Basic 2 (alias pb2): 600 x 800, 167 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Nook Simple Touch (alias nookst): 552 x 725, 167 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,0,0

    Kobo Touch (alias kbt): 600 x 730, 167 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kobo Glo (alias kbg): 758 x 942, 213 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kobo Glo HD (alias kghd): 1072 x 1328, 250 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kobo Glo HD Full Screen (alias kghdfs): 1072 x 1448, 250 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kobo Mini (alias kbm): 600 x 730, 200 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kobo Aura (alias kba): 758 x 932, 211 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kobo Aura HD (alias kbhd): 1080 x 1320, 250 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kobo H2O (alias kbh2o): 1080 x 1309, 265 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kobo H2O Full Screen (alias kbh2ofs): 1080 x 1429, 265 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4

    Kobo Aura One (alias kao): 1404 x 1713, 300 dpi
        Mark corners=0, Padding (l,t,r,b)=0,0,3,4

    Nexus 7 (alias nex7): 1187 x 1811, 323 dpi
        Mark corners=1, Padding (l,t,r,b)=0,0,3,4
willus is offline   Reply With Quote
Advert
Old 06-30-2019, 08:17 PM   #1701
MarjaE
Guru
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: 924
Karma: 53902736
Join Date: Jun 2015
Device: multiple
Thank you. I'm still trying to find free pdfs which are reliably-enough broken.
MarjaE is offline   Reply With Quote
Old 07-01-2019, 05:33 AM   #1702
MarjaE
Guru
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: 924
Karma: 53902736
Join Date: Jun 2015
Device: multiple
After several more tries, I finally processed the hardest of these files... so none are completely broken.

I don't know if it caused any of the trouble, but I uninstalled Malwarebytes for the time being.

Here is a free pdf which gave me a lot of trouble though: https://gallica.bnf.fr/ark:/12148/bpt6k6348270v (there's an option to download the book as a pdf.)

When running in the command line with -mode copy -dev dx, I was getting frequent seg faults. I still get some.

When running in the Mac Automator, I get other error messages, and the Automator still often drops out when the regular interface would keep going.
MarjaE is offline   Reply With Quote
Old 07-01-2019, 11:25 PM   #1703
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: 1,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by MarjaE View Post
After several more tries, I finally processed the hardest of these files... so none are completely broken.

I don't know if it caused any of the trouble, but I uninstalled Malwarebytes for the time being.

Here is a free pdf which gave me a lot of trouble though: https://gallica.bnf.fr/ark:/12148/bpt6k6348270v (there's an option to download the book as a pdf.)

When running in the command line with -mode copy -dev dx, I was getting frequent seg faults. I still get some.

When running in the Mac Automator, I get other error messages, and the Automator still often drops out when the regular interface would keep going.
Okay, well, I couldn't get any seg faults or other funny behavior with my version of k2pdfopt on that file with Windows 10, but there are several options you may want to use to help it fit your DX screen better and to improve the contrast and conversion speed. Try this, for example:

k2pdfopt -mode tm -m 0.8,0.8,0.8,1.5 -n- -dev dx -idpi 144 french_book.pdf

I attached this conversion for pages 50-70 of the book. Here's what each option does:

-mode tm Tells k2pdfopt to trim each page to eliminate wasted margin space and save each new source page to a new destination page.

-m 0.8,0.8,0.8,1.5 Cuts off 0.8 inches around each source page, 1.5 inches off the bottom edge.

-n- Turn off native output mode so k2pdfopt can change the contrast of each page.

-idpi 144 This is probably most important. It overrides k2pdfopt's default mode of doubling the device resolution for rendering the PDF pages. Without this, k2pdfopt will render each input page at 333 dpi, which slows things way down and uses lots more memory than necessary. The source file has bitmaps that are only 72 dpi, so 144 dpi for rendering them internally in k2pdfopt is plenty.
Attached Files
File Type: pdf french_book_k2opt.pdf (2.98 MB, 197 views)
willus is offline   Reply With Quote
Old 07-05-2019, 01:20 AM   #1704
MarjaE
Guru
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: 924
Karma: 53902736
Join Date: Jun 2015
Device: multiple
Thank you. With -idpi 144, it runs straight through.
MarjaE is offline   Reply With Quote
Old 07-19-2019, 12:19 AM   #1705
MarjaE
Guru
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: 924
Karma: 53902736
Join Date: Jun 2015
Device: multiple
I got a bit mixed-up about what was going wrong, it's not that these can't complete processing, it's that they give errors when imported into Calibre and when trying to import Calibre metadata into the pdf.

[I.S. -toc- seems to solve the problem. The version there uses -idpi and not -toc-]

-idpi 144 doesn't seem to help with that.

I've attached an excerpt of one of the French histories, run through

-ui -mode copy -dev dx -idpi 144 -o %s_k2opt144.pdf

-p 778-780

Last edited by MarjaE; 07-19-2019 at 02:16 PM.
MarjaE is offline   Reply With Quote
Old 08-19-2019, 05:37 AM   #1706
SashaChernykh
Junior Member
SashaChernykh began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2019
Device: PC
bug(non-ascii): Cyrillic symbols in generated PDF

Sorry, I can't find k2pdfopt issue tracker (one thread in BBCode forum, really?), therefore, I post detailed issue to my GitHub tracker — https://github.com/Kristinita/SashaM...eous/issues/27.

@willus, please, review this issue, when you will have a free time.

Thanks.
SashaChernykh is offline   Reply With Quote
Old 08-20-2019, 09:04 PM   #1707
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: 1,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by SashaChernykh View Post
Sorry, I can't find k2pdfopt issue tracker (one thread in BBCode forum, really?), therefore, I post detailed issue to my GitHub tracker — https://github.com/Kristinita/SashaM...eous/issues/27.

@willus, please, review this issue, when you will have a free time.

Thanks.
Thank you for the detailed problem report. It is very thorough. The issue, I believe, is the PDF software you use to do the copying and pasting of the OCR text. The method I use to create the OCR layer is slightly unconventional, and some software (e.g. SumatraPDF) does not copy and paste correctly, but Adobe Acrobat Reader correctly copies and pastes into MS Word. See attached screen shot.
Attached Thumbnails
Click image for larger version

Name:	scrshot.png
Views:	179
Size:	63.8 KB
ID:	173057  
willus is offline   Reply With Quote
Old 08-21-2019, 01:42 PM   #1708
richbridger
Junior Member
richbridger began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2019
Device: Kobo Aura One
Hello @willus,

I am a happy user of k2pdfopt. Recently I tried to compile the program on my own, but due to some incompatibilities with mupdf 1.16 and some header files the build with cmake failed.

I created some patches that update the CMakeList.txt file and fix the mupdf version problems.

https://pastebin.com/wvAGYw24
https://pastebin.com/ZJrb8TWB
https://pastebin.com/VUKhjANT
https://pastebin.com/jJwK6UvU
https://pastebin.com/Xdz5c2CU
https://pastebin.com/rrRZ2uSK

You can apply them with patch -p1 <patchfile>. I hope that is somewhat helpful.

Greetings,
richbridger
richbridger is offline   Reply With Quote
Old 08-21-2019, 08:58 PM   #1709
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: 1,272
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by richbridger View Post
Hello @willus,

I am a happy user of k2pdfopt. Recently I tried to compile the program on my own, but due to some incompatibilities with mupdf 1.16 and some header files the build with cmake failed.

I created some patches that update the CMakeList.txt file and fix the mupdf version problems.

https://pastebin.com/wvAGYw24
https://pastebin.com/ZJrb8TWB
https://pastebin.com/VUKhjANT
https://pastebin.com/jJwK6UvU
https://pastebin.com/Xdz5c2CU
https://pastebin.com/rrRZ2uSK

You can apply them with patch -p1 <patchfile>. I hope that is somewhat helpful.

Greetings,
richbridger
Thanks! I'm impressed. The last version of mupdf I integrated with was v1.14, and they are notorious for changing their API's in new revisions, so I almost always have to fix my code that interfaces with their library when I compile with a new version.
willus is offline   Reply With Quote
Old 08-30-2019, 04:44 PM   #1710
Umesh
Nameless Being
 
Hello Mr. Willus Sir. Thank you for the software. If worked great for me for quite sometime, but now if I select the option of 'postprocess with ghostscript', the application crashes. This option worked fine on the day that I had earlier installed Ghostscript PostScript and PDF Interpreter. Could you list a possible solution and also could you please give a link to the precise exe file of Ghostscript that needs to be installed.
Regards,
Umesh
  Reply With Quote
Reply

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


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 08:51 PM.


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