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 12-26-2023, 11:24 AM   #2041
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
k2pdfopt v2.55 released

This version is compiled on the latest OS's with the latest C compilers and the latest third-party libraries. There is one bug fix (bookmarks work again). See details at the web site.
willus is offline   Reply With Quote
Old 01-05-2024, 05:05 AM   #2042
VladimirS
Connoisseur
VladimirS ought to be getting tired of karma fortunes by now.VladimirS ought to be getting tired of karma fortunes by now.VladimirS ought to be getting tired of karma fortunes by now.VladimirS ought to be getting tired of karma fortunes by now.VladimirS ought to be getting tired of karma fortunes by now.VladimirS ought to be getting tired of karma fortunes by now.VladimirS ought to be getting tired of karma fortunes by now.VladimirS ought to be getting tired of karma fortunes by now.VladimirS ought to be getting tired of karma fortunes by now.VladimirS ought to be getting tired of karma fortunes by now.VladimirS ought to be getting tired of karma fortunes by now.
 
Posts: 63
Karma: 302424
Join Date: Aug 2019
Location: Serbia, former Yugoslavia
Device: Pocketbook InkPad 3
K2pdfopt v2.55 works perfectly !
Happy New 2024. to all K2pdfopt users
VladimirS is offline   Reply With Quote
Old 01-19-2024, 03:43 PM   #2043
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
Thank you for confirming, Vladimir.
willus is offline   Reply With Quote
Old 01-20-2024, 04:37 AM   #2044
Yasuro
Junior Member
Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!Yasuro is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!
 
Posts: 3
Karma: 50592
Join Date: Oct 2022
Device: none
Yes, ver. 2.55 got rid of the TOC issue! TY!

Quote:
Originally Posted by willus View Post
This version is compiled on the latest OS's with the latest C compilers and the latest third-party libraries. There is one bug fix (bookmarks work again). See details at the web site.
I have just put ver. 2.55 to test and I am happy to report it got rid of the TOC issue! Thank you very much, Willus, for so swiftly addressing it!!! Much, much appreciated!

Yasuro
Yasuro is offline   Reply With Quote
Old 01-21-2024, 03:26 PM   #2045
Shohreh
Zealot
Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.
 
Posts: 148
Karma: 192898
Join Date: Jan 2016
Device: none
Hello,

I'm going through the options in k2pdfopt in order to read PDFs on a 6" e-reader, and have a few questions:

1. Are "Native PDF output" and "Re-flow text" related? I notice they are mutually exclusive, and sometimes are only available in certain modes

2. Under the hood, what is "reflow text", really? Does it mean that k2pdfopt will move text blocks leftward + downward, combine them into a single page before turning it from native PDF to a bitmap?

3. Would I have more chance converting a PDF into EPUB if I first run it through k2optpdf before opening its simplified output into Calibre and export as EPUB?

Thank you.
--
Edit: For some reason, -title "Some title" → "Some title.pdf"

Code:
k2pdfopt.exe -author "Some author" -title "Some title" -mode fw -p 1-5 -ls- intput.pdf
--
Edit: cropping doesn't remove data, it only hides them, and they show again when using Calibre to convert the cropped PDF to EPUB.

Is there a way to really remove the cropped data so it's gone in the output PDF?

Code:
k2pdfopt.exe -mode crop -cbox 0in,0.7in,-1in,-1in -o output.pdf input.pdf
ebook-convert.exe output.pdf output.epub --enable-heuristics

Last edited by Shohreh; 01-22-2024 at 05:19 AM.
Shohreh is offline   Reply With Quote
Old 01-22-2024, 04:52 AM   #2046
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 10,982
Karma: 85104795
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
if PDF is processed as an image and really cropped and converted back to a PDF, then it's really cropped.
Quoth is offline   Reply With Quote
Old 01-22-2024, 05:18 AM   #2047
Shohreh
Zealot
Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.Shohreh can program the VCR without an owner's manual.
 
Posts: 148
Karma: 192898
Join Date: Jan 2016
Device: none
Is there no way to hard-crop native PDF without first turning them into bitmaps?

Redaction annotation works as a way to remove text from a PDF.
Shohreh is offline   Reply With Quote
Old 02-02-2024, 06:53 AM   #2048
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Hi, I developed a calibre K2pdfopt plugin that uses k2pdfopt to optimize PDFs inside calibre. It can also be used as standalone—It still need calibre to be installed—GUI for Linux and OSX. It can work on Windows too, but the main program already has a GUI there. For more details you can see this post.

I have some questions to I hope you can provide the answers for:
  • I implemented a additional options box similar to the one in k2pdfopt Windows GUI. I want to give the options there precedence over any GUI setting, as this box supports calibre template language, which means users can customize the options per book inside calibre. In my testing it seems that whenever two options are in conflict, the last one wins. Is that reliable way to go about things? or are there situations where this assumption might not hold?
  • In the Windows GUI, there is an option called "Fast Preview". On examination I saw it associated with the -rt option. The help page mentions that this option controls the degrees of rotation of the source page. I can't see how this can make a "Fast Preview", so I opted to leave it out until I understand more about it.
  • I cannot see an option to control where to put the output for the -bmp option. Since the plugin also works inside the calibre, it is imperative to not give any binary direct access to files instead the library. It is not a big deal as I circumvented this by copying the source file to temporary location before previewing. Just wondering if I missed something here?
  • Is there a way to validate any supplied args inside the optional arguments. Like running the command on a simulation basis to make it spit out error codes and messages without actually doing the conversion.
  • I opted for now to leave out the OCR option (users can still it manually in the additional options box). The reason is that it has many languages and I am not sure if they are going to be available on every system where k2pdfopt is installed, and what kind of verification I might do to ensure the user settings can be honored. My question is does output of -ocrlang ? differ for system to system? or does the fact that k2pdfopt is installed ensures all these languages are available on all systems?
  • The one option I wanted to include in the GUI and couldn't is the -ci option to reinsert the cover of the source pdf into the optimized version. Problem is it always returns the following error:
    Code:
    Segmentation fault (core dumped)
    The error code for the error is 139. Here is a link for a book if you are interested in examining what happens.
    Note to moderators: The book linked to is legally available from hindawy.org based on an agreement with copyright holders.
  • I am having problems with the preview option, when I run the following command on the book linked above:
    Code:
    k2pdfopt -x -ui- -bmp 31 harafeesh.pdf
    Instead of previewing page 31 it actually previews page 19. How to rectify this?

    Edit: I am currently getting around this by extracting the target preview page to a separate pdf file using the -mode copy and then running -bmp 1 on the extracted pdf.
  • Also would like to know if possible to use k2pdfopt to get information about pdf and djvu files. I am specially interested in page count. I can see an info button in the Windows screenshots and I suppose that's what they do.

Last but not least, thanks for the efforts and the great program.
Attached Thumbnails
Click image for larger version

Name:	calibre_linux.png
Views:	54
Size:	98.8 KB
ID:	206162   Click image for larger version

Name:	no_calibre.png
Views:	51
Size:	106.9 KB
ID:	206163   Click image for larger version

Name:	no_calibre_progress.png
Views:	57
Size:	123.7 KB
ID:	206164   Click image for larger version

Name:	no_calibre_details.png
Views:	60
Size:	135.2 KB
ID:	206165  

Last edited by capink; 02-05-2024 at 09:31 AM.
capink is offline   Reply With Quote
Old 02-11-2024, 04:04 PM   #2049
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 Shohreh View Post
1. Are "Native PDF output" and "Re-flow text" related? I notice they are mutually exclusive, and sometimes are only available in certain modes
Sorry for the late reply. "Native PDF" means the output consists of the original PDF source and then each page is just a sequence of cropped regions from that source material. To do that at the re-flow level is not practical--too many cropboxes and would overload most readers. The other option is that k2pdfopt simply builds a simple bitmap of each output page, so in that case re-flow works fine. That's why they are mutually exclusive.

Quote:
Originally Posted by Shohreh View Post
2. Under the hood, what is "reflow text", really? Does it mean that k2pdfopt will move text blocks leftward + downward, combine them into a single page before turning it from native PDF to a bitmap?
That's right. k2pdfopt determines word locations and then re-organizes the words on each bitmapped page to fit the page size best. If you use the -sm option, you can get more of an idea of what it is doing.

Quote:
Originally Posted by Shohreh View Post
3. Would I have more chance converting a PDF into EPUB if I first run it through k2optpdf before opening its simplified output into Calibre and export as EPUB?
These are my (dated) comments on epub conversion.

Quote:
Originally Posted by Shohreh View Post
Is there a way to really remove the cropped data so it's gone in the output PDF?
You started a thread on hard trimming PDFs not long ago.
willus is offline   Reply With Quote
Old 02-11-2024, 04:50 PM   #2050
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
Bummer--I had responded to all of your questions and hit "Submit Reply" and mobileread decided to log me out and lose all my changes. Ugh. I'll start again...

Quote:
Originally Posted by capink View Post
I implemented a additional options box similar to the one in k2pdfopt Windows GUI. I want to give the options there precedence over any GUI setting, as this box supports calibre template language, which means users can customize the options per book inside calibre. In my testing it seems that whenever two options are in conflict, the last one wins. Is that reliable way to go about things? or are there situations where this assumption might not hold?
Yes, that should work. K2pdfopt processes command-line options left to right so the ones at the end should over-write the ones from before.

Quote:
Originally Posted by capink View Post
In the Windows GUI, there is an option called "Fast Preview". On examination I saw it associated with the -rt option. The help page mentions that this option controls the degrees of rotation of the source page. I can't see how this can make a "Fast Preview", so I opted to leave it out until I understand more about it.
When k2pdfopt first processes a source PDF, it tries to figure out how it is generally oriented, so it looks at 10 pages within the document (evenly spaced throughout) and for each page does analysis to see if it should rotate the page 90 degrees to get the text oriented horizontally. This takes some time, so using the -rt option in the right way tells it not to do this, hence speeding up the preview.

Quote:
Originally Posted by capink View Post
I cannot see an option to control where to put the output for the -bmp option. Since the plugin also works inside the calibre, it is imperative to not give any binary direct access to files instead the library. It is not a big deal as I circumvented this by copying the source file to temporary location before previewing. Just wondering if I missed something here?
You did not miss anything, and you came up with a good solution, but it would be easy to add an option to specify the file name of the -bmp output.

Quote:
Originally Posted by capink View Post
Is there a way to validate any supplied args inside the optional arguments. Like running the command on a simulation basis to make it spit out error codes and messages without actually doing the conversion.
No. I'm not even sure how I would do that.

Quote:
Originally Posted by capink View Post
I opted for now to leave out the OCR option (users can still it manually in the additional options box). The reason is that it has many languages and I am not sure if they are going to be available on every system where k2pdfopt is installed, and what kind of verification I might do to ensure the user settings can be honored. My question is does output of -ocrlang ? differ for system to system? or does the fact that k2pdfopt is installed ensures all these languages are available on all systems?
The output from -ocrlang will vary depending on the environment, e.g. what language training files have been downloaded. Note that k2pdfopt will try to download any needed training file per my command-line option help on -ocrlang.

Quote:
Originally Posted by capink View Post
The one option I wanted to include in the GUI and couldn't is the -ci option to reinsert the cover of the source pdf into the optimized version. Problem is it always returns the following error:
I was able to reproduce this issue. I'll look into it. I have not used that option in a long time.

Quote:
Originally Posted by capink View Post
I am having problems with the preview option, when I run the following command on the book linked above. Instead of previewing page 31 it actually previews page 19. How to rectify this? Edit: I am currently getting around this by extracting the target preview page to a separate pdf file using the -mode copy and then running -bmp 1 on the extracted pdf.
The page number specifies the output file page number, not the source file page number. But it looks like you've come up with a good work-around.

Quote:
Originally Posted by capink View Post
Also would like to know if possible to use k2pdfopt to get information about pdf and djvu files. I am specially interested in page count. I can see an info button in the Windows screenshots and I suppose that's what they do.
Use the -i option.
willus is offline   Reply With Quote
Old 02-11-2024, 04:53 PM   #2051
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 capink View Post
Hi, I developed a calibre K2pdfopt plugin that uses k2pdfopt to optimize PDFs inside calibre. It can also be used as standalone—It still need calibre to be installed—GUI for Linux and OSX. It can work on Windows too, but the main program already has a GUI there. For more details you can see this post.
BTW thank you for doing this, and very nice work. I'll post a link to it on my k2pdfopt user contributions page hopefully sometime soon.
willus is offline   Reply With Quote
Old 02-13-2024, 02:36 PM   #2052
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by willus View Post
BTW thank you for doing this, and very nice work. I'll post a link to it on my k2pdfopt user contributions page hopefully sometime soon.
Thanks for you detailed reply and your work.
capink is offline   Reply With Quote
Old 02-18-2024, 10:56 AM   #2053
braxman
Junior Member
braxman began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2024
Device: sony dpt-s1
Hi there! I've been working in a custom way to read papers on a pdf-based e-ink reader and annotate with a stylus, but I also wanted to use cropped pdf files in the device. Came to use pdf-crop-margins because I can crop the file, send to e-reader, anotate, and then also and crucially undo the cropping while retaining the annotations in the file now in its orginal size for greater glory of PC screen display.

But the cropping tool is quite limited compared with the smart cropping that k2pdfopt does (no splitting of pages, for instance).

TL;DR: Is there a way to undo the k2pdfopt process recovering the original file from the transformed (and annotated) one? If not, can I suggest that as a feature request?
braxman is offline   Reply With Quote
Old 02-18-2024, 12:06 PM   #2054
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 braxman View Post
TL;DR: Is there a way to undo the k2pdfopt process recovering the original file from the transformed (and annotated) one? If not, can I suggest that as a feature request?
Sorry but this would involve more thinking and new programming than I am up for. I never intended k2pdfopt to have "undo" functionality. I figured people would keep the original source file.
willus is offline   Reply With Quote
Old 02-19-2024, 08:32 AM   #2055
braxman
Junior Member
braxman began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2024
Device: sony dpt-s1
undo

Quote:
Originally Posted by willus View Post
Sorry but this would involve more thinking and new programming than I am up for. I never intended k2pdfopt to have "undo" functionality. I figured people would keep the original source file.
Ok no problem, great software, writing native pdf output is a quantum leap. Thanks for all.
braxman 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 03:55 AM.


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