View Single Post
Old 04-11-2015, 10:41 AM   #1045
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,303
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
Quote:
Originally Posted by RTL View Post
(1) When re-flowing partially filled, center aligned text with extra justification option, I could not align it either right or left. ...

(2) When reflowing text, if some words at the end of the current line in original text do no fit there, it will be wrapped to next line, partially filling the line, in which there are some space. ...

(3) Is there any way to find out bitmap pdf's original resolution? ... If we reflow some previously-generated, resolution-unknown bitmap pdf, we could set the resolution as high as the original resolution, but not higher. If we set higher, what I think is that it just increases file size, but not resolution. Am I right?
(1) and (2): The justification options are set with the -j option:

-j -1|0|1|2[+/-] Set output text justification. 0 = left, 1 = center,
2 = right. Add a + to attempt full justification or a -
to explicitly turn it off. The default is -1, which tells
k2pdfopt to try and maintain the justification of the
document as it is. See also -wrap.


There is some fuzzy logic in k2pdfopt with the re-flow. If it thinks that one or more lines are significantly shorter than neighboring lines, then it won't re-flow to the next line because it assumes that these short lines are terminating a paragraph and/or are not meant to flow to the next line. This is probably what is happening in your second case. As always it helps me if you can post a source PDF file so that I can experiment with options that may help. Did you use -wrap+ (the GUI default)? The + will tell k2pdfopt to un-wrap short lines in cases where k2pdfopt determines that the neighboring lines are part of the same paragraph.

(3): The "pdfinfo" program from the MuPDF distro will tell you what is in a PDF file, including the bitmaps and what resolution they are. You can get a win64 version here. It runs from the command line. You've given me a good idea, though--I'll try to add a feature to the next rev of k2pdfopt (and the MS Windows GUI) which will report the information from the PDF file (like pdfinfo). You are correct that there is no point to using an output dpi significantly higher than the source dpi if the source PDF has only bitmapped pages.

Last edited by willus; 04-11-2015 at 10:46 AM.
willus is offline   Reply With Quote