K2PDFOPT重排PDF,设置对比度,优化排版

早期在读研的时候,就在找把PDF扫描文件清晰化,有些扫描书籍出来的PDF,又是歪的,又是糊的,看起来非常费劲,网上搜索 PDF 对比度 PDF 清晰化,一般的方案就是下载adobe acrobat,然后到处图片,放入PS处理,这个方案还是洗洗睡吧,几百个PDF,你让我这样搞?

近段时间,突然在思考,既然国内电子书看PDF可以对PDF进行重新排版,进行字体大小设置、对比度设置等,说明这个肯定是有办法的。后来把kindle也拿出来看了下,试了下越狱+KOReader方案,也是可以重排PDF的,而且效果真的非常不错。

最终,找到了K2PDFOPT,这个是国外的一个非常成熟的PDF优化工具,硬核老外写的,但都是一堆英文资料,特别是一大堆的参数设置,绝对吓跑所有人,但经过我2-3天的调试,得出结论,这个玩意儿绝对好,肯定能解决我的问题。

K2PDFOPT可以用在2个地方,一个是电子书上,一个是电脑上优化PDF看起来舒服些

电子书这个没啥好说的,国内的电子书基本都有这个功能,kindle的KOReader内核就是用K2PDFOPT的。

这篇文章,我专门分享如何在电脑上优化优化PDF看起来舒服些,先看下结果吧。

这个是歪的原始稿件

这个是优化后的结果

对于字体模模糊糊的处理对比

感觉如何?是不是赞爆了

完整参数如下:
-as -n- -wrap- -col 1 -vb -2 -w 1s -h 1s -c -t- -f2p -2 -m 0 -om 0 -pl 0 -pr 0 -pt 0 -pb 0
上面参数目的:

  1. 把歪的拉正
  2. 把字体清晰化、纸质化、拉高对比度
  3. 完全符合原有PDF的排版

下面是我的调试过程,可供参考

  1. -n -wrap- -col 1 -vb -2 -t -p 41,42
  2. -n -wrap- -col 1 -vb -2 -t -er 1 -p 41,42 //针对1,在有-n情况下,-er无效
  3. -wrap- -col 1 -vb -2 -t -p 41,42 //针对1,拿掉-n,整体已经开始优化了
  4. -n -col 1 -vb -2 -t -p 41,42 // 针对1,拿掉 -wrap- ,也没有关系,因为有-n
  5. -col 1 -vb -2 -t -p 41,42 针对4,但如果-n也拿掉,就开始换行了,排版一下子都乱了
  6. -wrap- -vb -2 -t -p 41,42 如果拿掉-n 并且强制不换行-wrap-,但这时拿走了-col 1 排版也会乱,因为会预测一些2栏排版,对于电脑上看电子书,咩有必要
  7. -wrap- -col 1 -t -p 41,42 针对3,拿走了-vb -2,相当于默认-vb 1.75有些标题开始变的很大
  8. -vb -1 -wrap- -col 1 -t -p 41,42 针对3,把-vb设置成-1,所有的行间距都变的很小
  9. -vb 3 -wrap- -col 1 -t -p 41,42 针对3,把-vb设置成3,仍旧标题开始变的很大
  10. -wrap- -col 1 -vb -2 -t- -p 41,42 针对3,设置-t-,使得-t无效,但好像不明显
  11. -as -wrap- -col 1 -vb -2 -t- -p 41,42 针对10,发现-t-不是无效,而是页面是歪的,所有没有trim边上空白成功而已
  12. -as -wrap- -col 1 -vb -2 -t -p 41,42 针对11,-t有效果了,边上被割了,设置成-t-就会留白
  13. -bp-- -as -wrap- -col 1 -vb -2 -t- -p 41,42 把bp关掉,不然会分页产生大量空白
  14. -bp-- -as -wrap- -col 1 -vb -2 -t- -p 19 -w 900 -h 1350 这个宽和高其实就是设置一个比例关系

这个是macos的运行界面:


当然还有windows的图形界面版本,但也没啥差别,那个图形化的界面,我也就呵呵了

下面是完整的参数说明,仅供无法上国外网站的朋友备用参考:(原始地址:https://www.willus.com/k2pdfopt/help/options.shtml)

LIST OF K2PDFOPT COMMAND-LINE OPTIONS
This is the entire list of k2pdfopt command-line options that come directly from the "usage" output of k2pdfopt. You can get this list by typing ? at the interactive menu or with the command-line option -?.

To see how to use these options with k2pdfopt, see the "Customizing K2pdfopt" menu at the left, e.g. using a shortcut or using an environment variable. Many of these options have equivalents in the interactive menu. You can also type any of these options into the "Additional Options" text field in the MS Windows GUI to enable options that are otherwise not accessible from the GUI.

k2pdfopt v2.53 (w/MuPDF,DjVuLibre,OCR) (c) 2020, GPLv3, http://willus.com
Compiled Jul 18 2020 with Gnu C (Mingw64) v9.3.1 for Win64 on x64.

usage: k2pdfopt [opts]

(Or just drag a PDF or DJVU (.djvu) file to this icon.)

Attempts to optimize PDF (or DJVU) files (especially two-column ones) for
display on the Kindle (or other mobile readers/smartphones) by looking for
rectangular regions in the file and re-paginating them without margins and
excess white space. Works on any PDF or DJVU (.djvu) file, but assumes it
has a mostly-white background. Native PDF files (not scanned) work best.

If given a folder, k2pdfopt first looks for bitmaps in the folder and if
any are found, converts those bitmaps to a PDF as if they were pages of a
PDF file. If there are no bitmaps in the folder and if PDF files are in
the folder, then each PDF file will be converted in sequence.

Output files are always .pdf and have _k2opt added to the source name by
default (see -o option to specify alternate output name.)

K2PDFOPT environment variable

You can supply command-line options via the environment variable K2PDFOPT,
for example,

 set K2PDFOPT=-ui- -x -j 0 -m 0.25

Command line options from the command line take precedence over the ones in
the environment variable K2PDFOPT.

Command Line Options

-?[-] [pattern] Show [don't show] usage only (no file processing).
If pattern is specified, only options with text matching
the pattern are shown. The pattern can use * as a wild
card, e.g. -? -col. Use -?- to turn off usage.
Combine with -ui- to get something you can redirect
to a file.
-a[-] Turn on [off] text coloring (use of ANSI color codes) on
the screen output. Default is on.
-ac[-] [] Auto crop. For books or papers that have dark edges
due to copying artifacts, this option will attempt to
automatically crop out those dark regions so that k2pdfopt
can correctly process the source file. The
factor is from 0 to 1. Higher is more aggressive cropping.
Default if not specified is 0.1. See also -m.
Default value is off (-ac-).
Note that autocropping does not work on cropped regions
created with -cbox. See -dw for a discussion about this.
-as[-] [] Attempt to automatically straighten tilted source pages.
Will rotate up to +/- degrees if a value is
specified, otherwise defaults to 4 degrees max. Use -1 to
turn off. Default is off (-as -1 or -as-).
Note that autostraighten does not work on cropped regions.
See -dw for a discussion about this.
-author Set the author metadata / property of the PDF output
file(s). Default is to use the author of the source document
(-author "").
-bmp[-] Generate [do not generate] a bitmap rendering of converted
page number and write it to file k2pdfopt_out.png.
If this option is used, no other files are written, i.e. the
complete conversion is NOT done--ONLY the bitmap file is
written. If -sm is also specified, then the bitmap is of
marked source page . If -bmp-, then is not
necessary. Default is -bmp-.
-bp[+|-|--] [m|] Break [do not break] output pages at end of each input
page. Default is -bp-. If a numeric value is put after -bp,
then rather than breaking the output page at the end of each
input page, a gap is inserted of that many inches, e.g.
-bp 1 will insert a 1-inch gap between contents of each
input page. Special option -bp+ will break the pages at
the green boundaries between region as marked by the -sm
option (see -sm). If bookmark information is available
and -toc is specified (on by default) page breaks will be
inserted in the converted file at each bookmark unless -bp--
is specified. If "-bp m" is specified, then a page break
is inserted after each major (red-box) section. This can
help prevent text selection overlap problems in native output
mode. See also -toc, -bpl.
-bpc Set the bits per color plane on the output device to .
The value of can be 1, 2, 4, or 8. The default is 4
to match the kindle's display capability. This is ignored
if the -jpg option is specified.
-bpl Insert page break in destination file before each source
file page listed in . This has the same format
as the -p option. See also -p, -bp, -toc, -toclist. Default
is no page list. Example: -bpl 10,25,50,70,93,117,143.
This automatically sets -bp to it's default value (-bp-).
-bpm[] Set a page break mark type and color. This option allows
you to put colored marks in the PDF file to specify where to
break pages or where to avoid page breaks. is either
1 to force a page break or 2 to prevent a page break until
next mark. is an R,G,B triplet, 0-1 for each color
component, no spaces. For example, to break the page
wherever the source file has a green dot or short green
horizontal line: -bpm1 0,1,0. Use = -1 to clear.
If you omit the , 1 is assumed.
-c[-] Output in color [grayscale]. Default is grayscale.
-cbox[|u|-] Similar to the -grid option, but allows you to
specify exact crop boxes from the source page which will
then be processed as major (red-box) regions. These regions
can then become individual output pages or can be processed
further (searched for columns, re-flowed, etc.) depending on
what other options are selected. By default, they are
processed further, like every other major region.
You may specify the -cbox option multiple times to crop out
different parts of each source page, each crop being treated
as a major region. See the -mode command. To have each
crop box become a new page in the output file, for example,
use -mode crop, e.g.
k2pdfopt myfile.pdf -mode crop -cbox 2in,3in
has the format ,,,
where all values are specified from the upper-left corner of
the source page, with units, like the -w and -h options,
except that the default units for -cbox are inches. If only
and are specified, then and
extend to the edge of the page.
Example: -cbox 1in,1in,6in,9in (same as -cbox 1,1,6,9).
This specifies a crop box that is 6 x 9 inches and which
has an upper left corner which is 1 inch from the left
and top of the source page.
Use -cbox- to clear all cropboxes, which defaults back to
processing every page without any crop boxes.
You can use a page list, , to specify on which
pages to apply the cropboxes.
Examples:
-cbox5-51o ... applies the cropbox on pages 5,7,9,...,51.
('o' = odd. Use 'e' for even.)
-cbox1,2-5,13,15 ... applies the cropbox on pages 1,2,3,
4,5,13, and 15.
-cboxc ... applies to the cover image.
(see -ci option.)
Be sure not to put a space between -cbox and the page list.
Use -cboxu to set a crop box for all unspecified pages.
E.g. -cbox1-10 -cboxu will apply to
all pages 1 to 10 and to all other pages.
The default is no crop boxes (-cbox-). See also -m, -ac.
USAGE NOTE: Once you specify -cbox at least one time, only
the crop boxes you specify (and any associated page ranges)
are processed/converted by k2pdfopt. No other pages or
regions are processed. So if you want to specify a special
cropbox for the first page, for example, but then have all
remaining pages treated entirely, you must specify this:
-cbox1 ... -cboxu 0,0
(-cboxu 0,0 applies a full-page cropbox to all other
pages. u = unspecified.)
The -cbox2- 0,0 will set the cropbox for pages 2 and beyond
to the full page size.
See also: -ibox.
-cg Minimum column gap width in inches for detecting multiple
columns. Default = 0.1 inches. Setting this too large
will give very poor results for multicolumn files. See also
-cgmax.
-cgmax Max allowed gap between columns in inches. If the gap
between two regions exceeds this value, they will not be
considered as separate columns. Default = 1.5. Use -1 for
no limit (disable). See also -cg.
-cgr Set column-gap range, 0 - 1. This is the horizontal range
over which k2pdfopt will search for a column gap, as a
fraction of the page width. E.g. -cgr 0.5 will search
from 0.25 to 0.75 of the page width for a column gap.
Set this to a small value, e.g. 0.05, to only search for
column breaks in the middle of the page. Default = 0.33.
-ch Minimum column height in inches for detecting multiple
columns. Default = 1.5 inches.
-ci[-] Specify a cover image for the first page of the converted
PDF. can be a bitmap file (png or jpg) or can be
a page from a PDF file, e.g. myfile.pdf[34] would use page 34
of myfile.pdf. You can just specify an integer, e.g. -ci 50
to use page 50 of the source file being converted as the
cover page. Default is -ci-, which is no cover image.
NOTE: -ci only works with bitmapped output--it does not
(yet) work with native PDF output.
-cmax Set max contrast increase on source pages. 1.0 keeps
contrast from being adjusted. Use a negative value to
specify a fixed contrast adjustment. Def = 2.0.
See also -er.
-col Set max number of columns. can be 1, 2, or 4.
Default is -col 2. -col 1 disables column searching.
Columns will be displayed left to right unless -r is
specified, in which case they will be displayed right
to left. You can use the -go option to override this.
-colorbg (or -colorfg) |[,|[,...]]
Map the color white (background color, for -colorbg) or the
color black (text color, for -colorfg) to ,
where is a 6-digit hex RRGGBB representation of a
color, e.g. ffffff for all white, 000000 for all black,
ff0000 for bright red, etc. If is not a grayscale
color, the -c (color output) option will be turned on
automatically. This option only works with bitmapped output
(not native--see -n). Grayscale colors between black and
white will be linearly interpolated between the specified
-colorbg and -colorfg colors. If the source document has
colors, only (mostly) grayscale pixels are affected if ! is
put before the color, e.g. -colorbg !ffffd0
A bitmap can also be specified, e.g. -colorbg myfile.jpg.
In this case, the bitmap gets tiled in as the background.
If you specify a comma delimited list of colors (or bitmaps),
then consecutive rows of text are colored with the
consecutive colors. This is a possible way to make the
rows of text easier to follow, e.g. -colorfg ff0000,00 will
color alternate rows of text red and black.
Default is -colorbg "" and -colorfg "" (no mappings).
-comax Stands for Column Offset Maximum. The given is as a
fraction of the width of a single column, and it specifies
how much the column divider can move around and still have
the columns considered contiguous. Set to -1 to revert back
to how columns were treated in k2pdfopt v1.34 and before.
Default = 0.3.
-crgh Set the min height of the blank area that separates regions
with different numbers of columns. Default = 1/72 inch.
-d[-] Turn on [off] dithering for bpc values < 8. See -bpc.
Default is on.
-ddr[-] Detect Double Rows. [Expert mode.] By default this is on.
Use -ddr- to turn off. This option does extra analysis to
try and separate text rows by looking for double and triple
rows that may have been missed on the first pass. This can
have the unintended consequence of breaking up figures
across pages.
-de Defect size in points. For scanned documents, marks
or defects smaller than this size are ignored when bounding
rectangular regions. The period at the end of a sentence is
typically over 1 point in size. The default is 1.0.
-dev Select device profile (sets width, height, dpi, and corner
marking for selected devices). Currently the selection is
limited. just has to have enough characters to
uniquely pick the device. Use -dev ? to list the devices.
Default is -dev kindle2.
-dpi Same as -odpi.
-dr Display resolution multiplier. Default = 1.0. Using a
value greater than 1 should improve the resolution of the
output file (but will make it larger in file size).
E.g. -dr 2 will double the output DPI, the device width
(in pixels), and the device height (in pixels).
-ds Override the document size with a scale factor. E.g. if
your PDF reader says the PDF file is 17 x 22 inches and
it should actually be 8.5 x 11 inches, use -ds 0.5. Default
is 1.0.
-dw[-] [] De-warp [do not de-warp] pages (uses Leptonica de-warp
algorithms). Default is not to de-warp. Does not work
for native mode output. Optional specifies the
fit order for the dewarping curves. Can be 2, 3, or 4.
Default is 4.
[Advanced: You can actually make the fit order a two-digit
code. E.g. -dw 24 will use 4th-order on each row of text
but only 2nd-order for columns of displacement (see
leptonica dewarpFindVertDisparity() in dewarp2.c)]
Note: de-warping, like auto-straighten and auto-crop, is
intended for entire pages. It does not work on cropped areas.
If you want it to work on cropped areas, you should run
k2pdfopt in two passes--first to create selected crop
areas (e.g. -mode crop), then to apply dewarping.
-ehl Same as -evl, except erases horizontal lines instead of
vertical lines. See -evl. Default is -ehl 0.
-er Use erosion filter on source bitmaps. Makes the text look
darker. A larger value of makes the text thicker/darker.
Try -er 1 or -er 2. Default is 0 (no erosion filtering).
Use a negative value for to do the erosion before the
constrast adjustment is applied. Use a positive value to
to the erosion after the constrast adjustment is applied.
This option may magnify scanning defects, so you might want
to combine with the -de (defect removal) option.
Has no effect in native mode output. See also -de, -g, -cmax.
-evl Detects and erases vertical lines in the source document
which may be keeping k2pdfopt from correctly separating
columns or wrapping text, e.g. column dividers. If is
zero, this is turned off (the default). If is 1, only
free-standing vertical lines are removed. If is 2,
vertical lines are erased even if they are the sides of
an enclosed rectangle or figure, for example.
-f2p Fit-to-page option. The quantity controls fitting
tall or small contiguous objects (like figures or
photographs) to the device screen. Normally these are fit
to the width of the device, but if they are too small or
too tall, then if =10, for example, they are allowed
to be 10%% wider (if too small) or narrower (if too tall)
than the screen in order to fit better. Use -1 to fit
a tall object entirely within the device screen no matter
what. Use -2 as a special case--all "red-boxed" regions
(see -sm option) are placed one per page.
Use -f2p -3 to fit as many "red-boxed" regions as
possible on each page without breaking them across pages.
(see -mode concat).
Default is -f2p 0. See also -jf, -fr.
Note: -f2p -2 will automatically also set -vb -2 to
exactly preserve the spacing in the red-boxed region. If
you want to compress the vertical spacing in the red-boxed
region, use -f2p -2 -vb -1.
-fc[-] For multiple column documents, fit [don't fit] columns to
the width of the reader screen regardless of -odpi.
Default is to fit the columns to the reader.
-fr[-] Figure rotate--rotates wide-aspect-ratio figures to landscape
so that they best fit on the reader page. Default is not
to rotate. See also -f2p.
-fs [+] The output document is scaled so that the median font size in
the converted file is points. If the value
is followed by a '+', the scaling is adjusted for every
source page, otherwise the font size is only adjusted once,
based on the median font size for the entire source document.
The default is -fs 0, which turns off scaling based on font
size. The use of -fs overrides the -mag setting.
-g Set gamma value of output bitmaps. A value less than 1.0
makes the page darker and may make the font more readable.
Default is 0.5. Has no effect with native-mode output.
See also -er, -cmax.
-go Grid order. Override order of processing for a gridded page
(see -grid) or for multiple columns. The following integer
codes are used: 1=left-to-right, 2=right-to-left,
3=top-to-bottom, 4=bottom-to-top. So -go 13 will first go
left to right, starting at the top row and then working
towards the bottom row, row by row. -go 31 will go top to
bottom starting with the left column and then working to the
right, column by column. The default is 31 unless -r is
specified, in which case it is 32. For multiple columns,
only 1 or 2 need be specified.
-grid x[x][+] Grid the source page into columns by rows with
with percent overlap. No regard will be made for trying
to break the page between columns or rows of text. If a +
is specified, the destination page order will go across and
then down, otherwise it will go down and then across. To
turn off gridding, specify a zero value for the columns or
for the rows. Default is no gridding. The default overlap
is 2%%. Example: -grid 2x2x5. By default, gridding also
sets the following options, which can be overridden by
following the grid option with other command options:
-n -wrap- -f2p -2 -vb -2 -col 1. For example, if you want
a column search done on each grid piece, you can put this:
-grid 2x2 -col 2. See also -go, -cbox.
-gs[-][-] Force use of Ghostscript instead of MuPDF to read PDFs.
K2pdfopt has built-in PDF translation (via the MuPDF
library) but will try to use Ghostscript if Ghostscript
is available and the internal (MuPDF) translation fails
(virtually never happens). You can force Ghostscript to
be used with this -gs option. Use -gs- to use Ghostscript
only if MuPDF fails. Use -gs-- to never use Ghostscript.
Download ghostscript at http://www.ghostscript.com.
-gtc Threshold value for detecting column gaps (expert mode).
Sets how many of the pixels in the column shaft can be
non-white (total height of a line crossing the shaft in
inches). See also -gtr. Default = .005.
-gtr Threshold for detecting gaps between rows (expert mode).
This option is commonly adjusted when lines of text in the
source file are too close together or slightly overlap and
don't have a clean gap between them. It effectively sets
how clean that gap has to be in order for k2pdfopt to
consider that there are separate rows of text. It does
this by setting the maximum total black pixels, in inches,
on average, that can be in each row of pixels before the gap
is no longer considered a gap. A higher value makes it
easier to detect gaps between rows of text. Too high of a
value may inadvertently split figures and other graphics.
For documents with nice clean spaces between each row of
text, this setting should not need to be adjusted.
Default = 0.006. See also -rsf.
-gtw Threshold for detecting word gaps (expert mode).
See -gtr. Default = .0015.
-gui[-] Use [don't use] graphical user interface (MS Windows only).
If k2pdfopt is started from a console (command-line), the
default is not to launch the gui unless there are no command-
line options given. If k2pdfopt is launched via its icon,
then the default is to launch the GUI.
-guimin[-] Start the k2pdfopt GUI minimized. Def = not minimized.
-h [in|cm|s|t|p|x] Set height of output device in pixels, inches, cm,
source page size (s), trimmed source region size (t),
pixels (p), or relative to the OCR text layer (x).
The default units are pixels (p), and the default value
is 735 (the height of the Kindle 2 screen in pixels).
Examples:
-h 6.5in Sets the device height to 6.5 in
(using the output dpi to convert to
pixels--see -dpi).
-h 1.5s Sets the device height to 1.5 times the
source page height (same as -h -1.5).
-h 1t Sets the device height to whatever the
trimmed page height is (you can follow
-mode copy with -h 1t to make the output
page height equal to the crop box height.
-h 0.5x Sets the device height to half of the
height of the box exactly surrounding
the OCR text layer on the source page.
See also -w, -dpi, -dr.
-hy[-] Turn on [off] hyphen detection/elimination when wrapping
text. Default is on.
-i Echo information about the source file (PDF only).
Disables all other processing.
-ibox[|-|u] Same as -cbox (see -cbox), except that these
boxes are ignored by k2pdfopt. This is done by whiting out
the boxes in the source bitmap. For native output, the
area in the -ibox will not affect the parsing of the source
file, but it may still be visible in the output file.
Default is no iboxes (-ibox-). See also -cbox.
-idpi Set pixels per inch for input file. Use a negative value
as a multiplier on the output dpi (e.g. -2 will set the
input file dpi to twice the output file dpi (see -odpi).
Default is -2.0.
-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.
-jf 0|1|2 [] Set figure (tall region) justification. If a figure
has left or right margins available, this option allows
you to set the justification differently than the text.
E.g. you can center figures with -jf 1. If you want to
specify a minimum height for figures (e.g. minimum region
height where this justification applies), you can tack it
on at the end, e.g. -jf 1 1.5 to center any region taller
than 1.5 inches. Default is 0.75 inches for the minimum
height and to use the same justification on figures as
the rest of the document (-jf -1). See also -f2p to fit
small or tall figures to the page.
-jfc[-|+] Attempt [do not attempt] to keep figure captions joined
with their figures. If you specify -jfc+, k2pdfopt will
also try to detect figure captions in multi-column documents.
This is not done by default because k2pdfopt will sometimes
(more often than not, in my experience) incorrectly choose
the multi-column layout if it is also trying to detect what
is a figure caption. See also -cg, -cgmax, -cgr, -crgh.
Default = -jfc.
-jpg [] Use JPEG compression in PDF file with quality level
(def=90). A lower quality value will make your
file smaller. See also -png. Use of -jpg is incompatible
with the -bpc option.
-l See -ocrlang.
-lang See -ocrlang.
-ls[-][pagelist] Set output to be in landscape [portrait] mode. The default
is -ls- (portrait). If an optional pagelist is specified,
only those pages are affected--any other pages are done
oppositely. E.g. -ls1,3,5-10 would make source pages 1, 3
and 5 through 10 landscape.
-m[l|t|r|b] [][,[units][,...]] Set global crop margins for
every page. If more than one value is given (comma-delimited
with no spaces in between), the order is left, top, right,
bottom, e.g. -m ,,,. You can also
use the more powerful -cbox option to do this same thing.
The default units are inches. For available units and their
descriptions, see -h.
Examples:
-m 0.5cm
Sets all margins to 0.5 cm.
-m 0.5cm,1.0cm
Sets the left margin to 0.5 cm and all the other
margins to 1.0 cm.
-m 0.2in,0.5in,0.2in,0.5in
Sets the left and right crop margins to
0.2 inches and the top and bottom to 0.5 inches.
-mt 1cm
Sets the top margin to 0.5 cm.
-m -0.1x,-0.1x,1.1x,1.1x
With the 'x' unit, the behavior is a little
different. Rather than specifying the widths
of each margin, you specify the position of
the crop box relative to the OCR text layer
in the source file, where 0x,0x,1x,1x would
exactly bound the OCR text layer.
The default crop margins are 0 inches.
[NOTE: The default was 0.25 inches for all margins before
v1.65.]
See also -cbox and -ac to autocrop scanning artifacts.
-mag Magnify the converted document (text) size by .
Default is -mag 1 (no magnification). See also -fs.
-mc[-] Mark [don't mark] corners of the output bitmaps with a
small dot to prevent the reading device from re-scaling.
Default = mark.
-mode Shortcut for setting multiple options at once which
determine the basic way in which k2pdfopt will behave.
Available modes are:
copy "Copy" mode. This isn't really intended for
use with an e-reader. It just creates a
bitmapped copy of your source document at the
exact same dimensions. This can be useful in
order to eliminate any font compatibility
issues or if you want to eliminate selectable
text (follow with -mode copy with -ocr-).
The equivalent settings are -n- -wrap- -col 1
-vb -2 -w 1s -h 1s -dpi 150 -rt 0 -c -t- -f2p
-2 -m 0 -om 0 -pl 0 -pr 0 -pt 0 -pb 0 -mc-.
Use -odpi to select the bitmap resolution.
Note 1: Use -mode copy -n if you want an exact
copy (output in native mode).
Note 2: The default gamma and contrast settings
are not reset by -mode copy. If you
want a perfect copy, do this:
-mode copy -gamma 1 -s- -cmax 1
fp "Fit Page" mode. Also can use -mode fitpage.
Fits the entire contents of each source page
onto the reader display. Same as -n -wrap- -col 1
-vb -2 -f2p -2 -t.
fw "Fit Width" mode. Fits the text to the width
of the reader in landscape mode without doing any
text re-flow. This is the best way to preserve
the original layout of the source document.
To fit to the reader width in portrait mode, add
-ls- after -mode fw to turn off landscape.
The -mode fw option is equivalent to -n -wrap-
-col 1 -vb -2 -t -ls. It was inspired by SoPDF's
"fit width" option. Can also use -mode sopdf
or -mode fitwidth
2col "Two-column" mode. Same as -n -wrap- -col 2
-vb -2 -t. Optimizes for a 2-column scientific
article with native PDF output.
tm "Trim margins" mode. Same as -mode copy, but
sets the output to be trimmed to the margins and
the width and height of the output to match the
trimmed source pages. Also uses native mode.
Equivalent to -n -wrap- -col 1 -vb -2 -f2p -2 -t
-w 1t -h 1t -rt 0 -c -m 0 -om 0 -pl 0 -pr 0 -pt 0
-pb 0 -mc-. Can also use -mode trim.
crop "Crop" mode. Used with the -cbox option, this
puts each cropped area on a separate page,
untrimmed, and sizes the page to the cropped
region. Same as -wrap- -col 1 -vb -2 -w 1t -h 1t
-t- -rt 0 -c -f2p -2 -m 0 -om 0 -pad 0 -mc- -n
concat "Concatenation" mode. Similar to -mode crop,
but keeps the output pages the same size as the
source pages and fits as many crop-boxed regions
onto each new output page as possible without
breaking them across pages. Equivalent to: -n
-wrap- -col 1 -vb -2 -t- -f2p -3 -fc- -w 1s -h 1s
-ocr-
def "Default" mode. This is the mode you get if you
run k2pdfopt with no customized options. It is
equivalent to -wrap -n- -col 2 -ocr m -vb 1.75
-dev k2 -rt auto -c- -t -f2p 0 -m 0 -om 0.02 -ls-
You can modify modes by overriding their options after
specifying the mode, e.g. -mode fw -vb -1.
-n[-] Use "native" PDF output format. NOTE: if you want native
PDF output, it's probably best to use a -mode option like
-mode fitwidth or -mode 2col, both of which automatically
turn on native PDF output and optimize other settings for it.
Native PDF output preserves the native source PDF contents,
i.e. the output PDF file is not rendered as a sequence of
bitmapped pages like in the default k2pdfopt output mode.
Instead, the source PDF's native content is used along with
additional PDF instructions to translate, scale, and crop
the source content. With native PDF output, if the source
file has selectable text, the text remains selectable in
the output file. The output file can also be zoomed
without loss of fidelity. This may also result in a
smaller output file (but not always). By default, native
PDF output format is turned off. See also -mode.
NOTES:
1. Native PDF output cannot be used with text wrapping
on (see -wrap option). Turning it on will disable
text wrapping.
2. Native PDF output is not recommended for source
files which are scanned (there is no benefit unless
the scanned document includes a layer of OCR text).
3. Native PDF output is incompatible with OCR (see -ocr),
though OCR is typically not necessary if the native PDF
contents are kept. Turning on native PDF output will
disable OCR.
4. Native PDF output can only be used with PDF source
files (it does not work with DJVU source files).
5. Contrast adjust, gamma correction, and sharpening
are disabled with native PDF output.
6. It is recommended that you use -vb -2 with native PDF
output, particularly if you are having difficulty
selecting/searching text in the output PDF file.
7. This option works well with -mode fw, -mode 2col, or
with the -grid option. It is used by default in those
cases.
-neg[-|+] Inverse [don't inverse] the output images (white letters
on black background, or "night mode"). If -neg+, inverts
all graphics no matter what. If just -neg, attempts to
invert text only and not figures. Default = -neg-.
See also -colorbg and -colorfg.
-ng Set gap between notes and main text in the output document.
The defaults to inches but can have other units (see
-h, for example). See -nl and -nr for how to turn on notes
processing. Default is -ng 0.2.
-nl[] [,]
-nr[] [,]
The source document has notes in the left (-nl) or right
(-nr) margins. Specific pages can be specified for the
notes using (same format as -cbox or -p). If
, are specified, they specify the
fraction of the page width where to look for the break
between the notes and the main page. E.g.
-nl 0.15,0.25 will look for the boundary between the notes
and the text between 15%% and 25%% of the way across the
source page. Use -nl- to turn off all processing of notes
in the margins (default). Default values for
and are 0.05 to 0.35 for -nl and 0.65 to 0.95
for -nr.
Notes in the margins are treated differently than other
"columns" of text. They will be interspersed with the
text in the adjacent column of main text.
Note that -nr... or -nl... will also set -cg to 0.05.
-nt Use parallel threads when OCR-ing a document
with the Tesseract OCR engine (GOCR is not thread safe).
This may provide a significant processing speed improvement
when using Tesseract OCR. Note that a higher number is not
always faster. You should experiment with your system to
find the optimum. A negative value is interpreted as a
percentage of available CPUs. The default is -50, which
tells k2pdfopt to use half of the available CPU threads.
Some performances I measured:
----------------------------------------------------------
OCR Speed
O/S CPU Nthreads improvement
----------------------------------------------------------
Win 10 x64 Core i5 2 (default) 1.5x
Win 10 x64 Core i5 3 1.6x
Win 10 x64 Core i5 4 1.8x
----------------------------------------------------------
Win 10 x64 Core i7 2 1.8x
Win 10 x64 Core i7 3 2.4x
Win 10 x64 Core i7 4 (default) 2.5x
Win 10 x64 Core i7 5 2.8x
Win 10 x64 Core i7 6 2.7x
Win 10 x64 Core i7 7 2.7x
Win 10 x64 Core i7 8 2.6x
----------------------------------------------------------
Linux x64 Core i5 2 (default) 1.9x
Linux x64 Core i5 3 2.6x
Linux x64 Core i5 4 2.7x
----------------------------------------------------------
Linux x64 Xeon E52690v2 2 1.9x
Linux x64 Xeon E52690v2 4 3.5x
Linux x64 Xeon E52690v2 6 5.1x
Linux x64 Xeon E52690v2 8 6.6x
Linux x64 Xeon E52690v2 10 (default) 8.7x
Linux x64 Xeon E52690v2 14 9.5x
Linux x64 Xeon E52690v2 20 10.2x
----------------------------------------------------------
Interestingly, Linux seems to have much better multithreading
performance than Windows. I suspect the OS/X results are
similar to the Linux results.
NOTE: -nt has no effect if you select -ocrd c or -ocrd p.
See -ocrd.
-o Set the output file name using . %s will be
replaced with the full name of the source file minus the
extension. %b will be replaced by the base name of the
source file minus the extension. %f will be replaced with
the folder name of the source file. %d will be replaced with
the source file count (starting with 1). The .pdf extension
will be appended if you don't specify an extension.
E.g. -o out%04d.pdf will result in output files out0001.pdf,
out0002.pdf, ... for the converted files. Def = %s_k2opt
-------------------------------------------------------------
BITMAP OUTPUT: For output to bitmaps, you can put -o .png
or -o .jpg (see -jpeg for quality setting).
-------------------------------------------------------------
MORE DETAIL: If ends in .jpg or .png, the output
will be in the JPEG or PNG bitmap format, respectively, one
bitmap per page. If your has no %d in it, then
%04d will be appended. If has only one %d, it will
get substituted with the page number. If it has two %d's,
the first will get the file count and the second will get the
page number. Example: if the source PDF is myfile.pdf, then
-o %s%03d.png would create myfile001.png, myfile002.png,
etc., for each page of the PDF.
-ocr[-] [g|t|m] Attempt [don't attempt] to use optical character
recognition (OCR) in order to embed searchable text into
the output PDF document. If followed by t or g, specifies
the ocr engine to use (tesseract or gocr). If followed by
m, and if the PDF document has text in it, then the MuPDF
engine is used to extract the text (sort of a virtual OCR).
If -ocr is specified with no argument, tesseract is used.
If tesseract fails (e.g. no language files found), GOCR
is used. The overall default operation of k2pdfopt is
-ocr m. See also -ocrvis and -ocrhmax.
NOTE: Turning on OCR will disable native PDF output.
DISCLAIMER: The main intent of OCR isn't to improve the
visual quality of the text at all--at least not the way
k2pdfopt does it. OCR is most useful on scanned PDFs
that don't have selectable text to begin with, but using
OCR with k2pdfopt on such documents doesn't change the
look of the output PDF file at all. The OCR text is
simply placed invisibly over the scanned text so that
you appear to be able to select the scanned text (when,
in fact, you are selecting the invisibly placed OCR
text). So the only time you will even notice the OCR
errors is if you try to search for a word and can't find
that word because the OCR of that word is incorrect, or
if you copy a selection of the OCR text and paste it
into something else so that you can actually see it.
-ocrcol If you are simply processing a PDF to OCR it (e.g. if you
are using the -mode copy option) and the source document has
multiple columns of text, set this value to the number of
columns to process (up to 4). Default is to use the same
value as -col.
-ocrd w|l|c|p Set OCR detection type for k2pdfopt and Tesseract.
can be word (w), line (l), columns (c), or page (p). Default
is line.
For -ocrd w, k2pdfopt locates each word in the scanned
document and passes individual words to Tesseract for
OCR conversion. This was the only type of detection before
v2.42 but is not an optimal OCR conversion method when
using Tesseract.
For -ocrd l, k2pdfopt passes each line of the converted
file to Tesseract for conversion. This typically gives
better results than -ocrd w since Tesseract can better
determine the text baseline position with a full line.
For -ocrd c, k2pdfopt detects each column of the converted
file and passes that to Tesseract for conversion.
For -ocrd p, k2pdfopt passes the entire output page of text
to Tesseract and lets Tesseract parse it for word positions.
Tesseract has done considerable code development for
detecting words on pages (more than k2pdfopt), so this
should also be a reliable way to create the OCR layer.
One drawback to -ocrd c or -ocr p is that there is no benefit
to using the OCR multithreading option (see -nt).
-ocrhmax Set max height for an OCR'd word in inches. Any graphic
exceeding this height will not be processed with the OCR
engine. Default = 1.5. See -ocr.
-ocrlang |? Select the Tesseract OCR Engine language. This is the
root name of the training data, e.g. -lang eng for English,
-ocrlang fra for French, -ocrlang chi_sim for simplified
Chinese. You can also use -l. The default language is
whatever is in your Tesseract trained data folder. If you
have more than one .traineddata file in that folder, the
one with the most recent time stamp is used.
NOTE 1: As of v2.52, k2pdfopt will download training files
from github as needed. You can append -fast to the training
file name to get the fast version, otherwise the best version
will be downloaded. If the default url fails, you can
specify the URL (folder name) in the environment variables
TESSDATA_URL and TESSDATAFAST_URL, e.g.
set TESSDATA_URL=https://raw.githubusercontent.com/tesseract-ocr/tessdata_best/master
You will be prompted to approve downloads unless you specify
the -y command-line option.
NOTE 2: Use -ocrlang ? to see the list of Tesseract language
files in your Tesseract data folder and available for
download.
NOTE 3: Using the -ocrvis t option will not show the OCR text
correctly for any character above unicode value 255 since
k2pdfopt does not use any embedded fonts, but the text
will convert to the correct Unicode values when copy /
pasted.
NOTE 4: Tesseract allows the specification of multiple
language training files, e.g. -ocrlang eng+fra would
specify English as the primary and French as the secondary
OCR language. In practice I have not found this to work
very well. Try multiple languages in different orders.
-ocrdpi Set the desired dpi of the bitmaps passed to the OCR engine
OR set the desired height of a lower case letter (e.g. 'e')
in pixels. If is positive, it is interpreted as dpi.
If is negative, the absolute value is interpreted as
a lowercase letter height in pixels. Any bitmapped text sent
to the OCR engine will be downsampled (if too large) so that
the appropriate dpi or lowercase letter size is achieved.
The default is 300 because I've found this works best
empirically for Tesseract v4.0.0 English OCR with font sizes
in the range 8 - 15 pts. Use a lower value if the font size
in your document is larger than 15 - 20 pts. Or use
-ocrdpi -24 if you have a wide range of font sizes.
Use -ocrdpi 0 to disable any downsampling.
-ocrout[-] Write [don't write] UTF-8 OCR text output to file
. See the -o option for more about how
works. Default extension is .txt. Default is
no output.
-ocrsort[-] When a PDF document has its own OCR/Text layer, this option
orders the OCR text layer by its position on the page. This
should not be necessary unless the OCR layer was very poorly
generated. Default is -ocrsort- (off).
-ocrsp[+|-] When generating the OCR layer, do an entire row of text at
once, with spaces between each words. By default (-ocrsp-),
each word is placed separately in the PDF document's OCR
layer. This causes problems with text selection in some
readers (for example, individual words cannot be selected).
Using -ocrsp- may fix behavior like this, but will result in
less accurate word placement since k2pdfopt does not try to
exactly match the font used by the document. Use -ocrsp+
to allow more than one space between each word in the row
of text in order to optimize the selection position.
-ocrvbb[-] Verify OCR bounding boxes. For PDF files that have a built-
in OCR layer, if the resulting text selection does not seem to
match the graphical word positions in the document, you can
try this option. It checks the bounding box for each word
from the OCR layer against the actual graphical placement of
the word in the document and "shrinks" the bounding box to
just fit around the word. This only affects non-native PDF
conversions. Default is -ocrvbb- (turned off).
-ocrvis Set OCR visibility flags. Put 's' to show the source doc,
't' to show the OCR text, and/or 'b' to put a box around
each word. Default is -ocrvis s. To show both the source
document and the OCR text overlayed on top: -ocrvis st.
See also -ocr. See also -ocrlang (the note about -ocrvis t).
-odpi Set pixels per inch of output screen (def=167). See also
-dr, -w, -h, -fc. You can also use -dpi for this.
See also -fs, -mag.
-om[b|l|r|t] [][,[units][,...]] Set the blank area margins
on the output device. Works very much like the -m option.
See -m for more about the syntax. Default = 0.02 inches.
Note that the 's', 't', and 'x' units for -om all behave
the same and scale to the device size. E.g. -om 0.1s will
make the device screen margins 0.1 times the device width
(for the left and right margins) or height (for the top and
bottom margins) of the output device screen.
-ow[-|+] [] Set the minimum file size (in MB) where overwriting the
file will not be done without prompting. Set to -1 (or
just -ow with no value) to overwrite all files with no
prompting. Set to 0 (or just -ow-) to prompt for any
overwritten file. Def = -ow 10 (any existing file
over 10 MB will not be overwritten without prompting).
Use the + option (-ow+) to rename the existing file
instead of overwriting it. Existing files will be renamed
as follows:
file_k2pdfopt.pdf --> file_k2pdfopt_old.pdf
See also -y option.
-p Specify pages to convert. must not have any
spaces. E.g. -p 1-3,5,9,10- would do pages 1 through 3,
page 5, page 9, and pages 10 through the end. The letters
'e' and 'o' can be used to denote even and odd pages, e.g.
-p o,e Process all odd pages, then all even ones.
-p 2-52e,3-33o Process 2,4,6,...,52,3,5,7,...,33.
Overridden by -px option. See -px.
-pad A shortcut for -pl, -pt, -pr, -pb. E.g. -pad 15,10,13,20
is the same as -pl 15 -pt 10 -pr 13 -pb 20. Also, using
-pad 15 will set all pads to 15, for example.
-p[b|l|r|t] Pad [bottom|left|right|top] side of destination bitmap with
rows. Defaults = 4 (bottom), 0 (left), 3 (right), and
0 (top). Example: -pb 10. This is typically only used on
certain devices to get the page to come out just right. For
setting margins on the output device, use -om. See also -pad.
-png (Default) Use PNG compression in PDF file. See also -jpeg.
-ppgs[-] Post process [do not post process] with ghostscript. This
will take the final PDF output and process it using
ghostscript's pdfwrite device (assuming ghostscript is
available). A benefit to doing this is that all "invisible"
and/or overlapping text regions (outside cropping areas) get
completely removed, so that text selection capability is
improved. The actual ghostscript command used is:
gs -dSAFER -dBATCH -q -dNOPAUSE -sDEVICE=pdfwrite
-dPDFSETTINGS=/prepress -sOutputFile=

The default is not to post process with ghostscript.
-px Exclude pages from . Overrides -p option. Default
is no excluded pages (-px -1).
-r[-] Right-to-left [left-to-right] page scans. Default is
left to right. See also -go option.
-rhmin Row Height Minimum. This sets the minimum height that any
text row or text-row-like object can be, in points. If
the object is less than this height, it will be ignored
in the converted file for the processes of formatting.
The default is -1 (which means it is not used).
This is an experimental option (as of v2.52).
-rls[+|-] Restore [+] or don't restore [-] the last command-line
settings from the environment variable K2PDFOPT_CUSTOM0.
The default (-rls) is to restore the settings if there are no
other command-line options specified when running (from.
either the command line or the K2PDFOPT env var.), unless
those options are "-gui" or specify a file name.
-rsf Row Split Figure of merit (expert mode). After k2pdfopt has
looked for gaps between rows of text, it will check to see
if there appear to be missed gaps (e.g. if one row is twice
the height of all the others). Increasing this value makes
it harder for k2pdfopt to split a row. Lowering it makes it
easier. Default value = 20.
-rt |auto[+]|aep Rotate source page counterclockwise by degrees.
NOTE: If you're trying to get "landscape" output so that
you can turn your reader on its side, use -ls instead of
-rt. The -rt option is intended to be used for when your
source PDF is incorrectly rotated--e.g. if you view it on
a standard PC reader and it comes up sideways.
can be 90, 180, 270. Or use "-rt auto" to examine up
to 10 pages of each file to determine the orientation used
on the entire file (this is the default). Or use "-rt aep"
to auto-detect the rotation of every page. If you have
different pages that are rotated differently from each other
within one file, you can use this option to try to auto-
rotate each source page. Use -rt auto+ to turn on auto-
detect even in preview mode (otherwise it is off).
See also -ls.
-s[-] Sharpen [don't sharpen] images. Default is to sharpen.
-sm[-] Show [don't show] marked source. This is a debugging tool
where k2pdfopt will mark the source file with the regions it
finds on them and the order in which it processes them and
save it as _marked.pdf. Default is not to show
marked source. Red regions are found on the first pass
(use -f2p -2 to put each red region on a separate page).
Green lines mark vertical regions affected by -vb and -vs.
Gray lines mark individual rows of text (top, bottom, and
baseline). Blue boxes show individual words (passed to OCR
if -ocr is specified).
-sp[-] For each file on the command-line, just echo the number
of pages--don't process. Default = off (-sp-).
-t[-] Trim [don't trim] the white space from around the edges of
any output region. Default is to trim. Using -t- is not
recommended unless you want to exactly duplicate the source
document.
-title Set the title metadata / property of the PDF output file(s).<br> Default is to use the title of the source document<br> (-title ""). The <title> string will be parsed for<br> special characters that allow you to substitute the file<br> name. See the -o option for a description of these<br> substitutions.<br> -to[-] Text only output. Remove figures from output. Figures are<br> determined empirically as any contiguous region taller than<br> 0.75 inches (or you can specify this using the -jf option).<br> Use -to- to turn off (default).<br> -toc[-] Include [don't include] table of contents / outline /<br> bookmark information in the PDF output if it is available<br> in the source file (works only for PDF source files and<br> only if MuPDF is compiled in). By default, a new destination<br> page is started at each bookmark location. Do disable this,<br> see the -bp option. If -toc- is specified, bookmark<br> information from the source file is ignored. See also<br> -toclist. Default is -toc.<br> -toclist <pagelist>|<file> Override the PDF source file's outline information<br> (bookmarks / table of contents) with either a list of source<br> pages or a file describing the table of contents. If you<br> specify a list of pages, e.g. -toclist 5,10,20,40,100<br> then those pages are marked as Chapter 1, 2, etc.,<br> respectively. If you specify a file name, the file should be<br> a text file formatted like this example:<br> 1 Introduction<br> 10 Chapter 1<br> +10 Chapter 1, Part A<br> +25 Chapter 1, Part B<br> ++25 Chapter 1, Part B, Subsection 1<br> ++27 Chapter 1, Part B, Subsection 2<br> +30 Chapter 1, Part C<br> 50 Chapter 2<br> 70 Chapter 3<br> The '+' indicates a sub-level heading (multiple +'s for<br> multiple sub-levels). The first number on the line is the<br> source page reference number. The rest of the text on the<br> line is the name of the chapter / subheading.<br> Note: This option overrides -toc. To get a template from<br> an existing PDF file, see the -tocsave option.<br> -tocsave <file> If an outline exists in the PDF file (and -toc is specified)<br> write that outline to text file <file> in the format required<br> by -toclist. See -toc, -toclist.<br> -ui[-] User input query turned on [off]. Default = on for linux or<br> if not run from command line in Windows.<br> -v Verbose output.<br> -vb <thresh> Set gap-size vertical-break threshold between regions that<br> cause them to be treated as separate regions. E.g. -vb 2<br> will break the document into separate regions anywhere<br> there is a vertical gap that exceeds 2 times the median<br> gap between lines of text. These separate regions may<br> then be scaled and aligned independently.<br> Special values: Use -vb -1 to preserve all horizontal<br> alignment and scaling across entire regions (vertical<br> spacing may still be adjusted). Use -vb -2 to exactly<br> preserve each region (both horizontal alignment and<br> vertical spacing--this is the value used by -mode fw, for<br> example). The default is -vb 1.75.<br> -vls <spacing> Set vertical line spacing as a fraction of the text size.<br> This can be used to override the line spacing in a document.<br> If 1, then single spacing is used. 2 = double spacing.<br> If negative, then the absolute value acts as the limiting<br> case. E.g., if you set -vls -1.5, then any the line<br> spacing of the original document is preserved unless it<br> exceeds 1.5 (times single spacing). Default = -1.2.<br> See also -vs.<br> -vs <maxgap> Preserve up to <maxgap> inches of vertical spacing between<br> regions in the document (marked in green when using -sm<br> option). This value has no effect if you use a negative<br> value for -vb. The default value is 0.25.<br> See also -vls, -vb.<br> -w <width>[in|cm|s|t|p] Set width of output device. Default is 560. See -h.<br> -wrap[-|+] Enable [disable] text wrapping. Default = enabled. If<br> -wrap+, regions of text with lines shorter than the mobile<br> device screen are re-flowed to fit the screen width. If<br> you use -wrap+, you may want to also specify -fc- so that<br> narrow columns of text are not magnified to fit your device.<br> Text wrapping disables native PDF output (see -n option).<br> See also -ws, -j, -fc, -n.<br> -ws <spacing> Set minimum word spacing for line breaking as a fraction of<br> the height of a lowercase 'o'. Use a larger value to make it<br> harder to break lines. If negative, automatic word spacing<br> is turned on. The automatic spacing leans toward breaking<br> long words between letters to be sure to fit text to the<br> device display. Def = -0.20. The absolute value of the<br> setting, if negative, is used as a minimum allowed value.<br> If you want k2pdfopt to aggressively break lines (e.g. break<br> apart long words if they don't fit on a line), use a smaller<br> absolute value, e.g. -ws -0.01. A positive value works as<br> it did in v2.18 and before. The default value was changed<br> from 0.375 in v2.18 to -0.20 in v2.20. See also -wrap.<br> -wt[+] <thresh> Any pixels whiter than <thresh> (0-255) are treated<br> as "white". Setting this lower can help k2pdfopt better<br> process some poorly-quality scanned pages or pages with<br> watermarks. Note that the pixels which are above <thresh><br> threshold value and therefore are treated as white are not<br> actually changed to pure white (255) unless the '+' is also<br> included. Otherwise, this only sets a threshold.<br> The default value for -wt is -1, which tells k2pdfopt to pick<br> the optimum value. See also -cmax, -colorfg, -colorbg.<br> -x[-] Exit [don't exit--wait for <Enter>] after completion.<br> -y[-] Assume [don't assume] "yes" to queries, such as whether<br> to overwrite a file. See also -ow. Also turns off any<br> warning messages.</pre></p> </article> </div> </div> </div> <!--PC和WAP自适应版--> <div id="SOHUCS" sid="1689062183490629632"></div> <script type="text/javascript" src="/views/front/js/chanyan.js"></script> <!-- 文章页-底部 动态广告位 --> <div class="youdao-fixed-ad" id="detail_ad_bottom"></div> </div> <div class="col-md-3"> <div class="row" id="ad"> <!-- 文章页-右侧1 动态广告位 --> <div id="right-1" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_1"> </div> </div> <!-- 文章页-右侧2 动态广告位 --> <div id="right-2" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_2"></div> </div> <!-- 文章页-右侧3 动态广告位 --> <div id="right-3" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_3"></div> </div> </div> </div> </div> </div> </div> <div class="container"> <h4 class="pt20 mb15 mt0 border-top">你可能感兴趣的:(K2PDFOPT重排PDF,设置对比度,优化排版)</h4> <div id="paradigm-article-related"> <div class="recommend-post mb30"> <ul class="widget-links"> <li><a href="/article/1902425464492847104.htm" title="文本纠错(Text Correction)" target="_blank">文本纠错(Text Correction)</a> <span class="text-muted">dundunmm</span> <a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E6%8C%96%E6%8E%98/1.htm">数据挖掘</a><a class="tag" taget="_blank" href="/search/%E6%96%87%E6%9C%AC%E7%BA%A0%E9%94%99/1.htm">文本纠错</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E6%8C%96%E6%8E%98/1.htm">数据挖掘</a><a class="tag" taget="_blank" href="/search/%E6%96%87%E6%9C%AC%E7%BA%A0%E9%94%99/1.htm">文本纠错</a><a class="tag" taget="_blank" href="/search/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/1.htm">深度学习</a> <div>文本纠错(TextCorrection)是自然语言处理(NLP)中的一个重要任务,旨在自动检测并修正文本中的错误,包括拼写、语法、语义等层面的错误。其核心目标是通过算法模型将错误文本转换为符合语言规范的表达。该任务在自动写作辅助、搜索引擎优化、智能客服、教育等多个领域具有广泛应用。输入:包含错误的原始文本(如“我明天要去北京,希望天汽好。”)输出:修正后的规范文本(如“我明天要去北京,希望天气好。</div> </li> <li><a href="/article/1902425467047178240.htm" title="Flutter IconButton完全指南:高效使用与性能优化秘籍" target="_blank">Flutter IconButton完全指南:高效使用与性能优化秘籍</a> <span class="text-muted">帅次</span> <a class="tag" taget="_blank" href="/search/Flutter/1.htm">Flutter</a><a class="tag" taget="_blank" href="/search/flutter/1.htm">flutter</a><a class="tag" taget="_blank" href="/search/android/1.htm">android</a><a class="tag" taget="_blank" href="/search/ios/1.htm">ios</a><a class="tag" taget="_blank" href="/search/android/1.htm">android</a><a class="tag" taget="_blank" href="/search/studio/1.htm">studio</a><a class="tag" taget="_blank" href="/search/macos/1.htm">macos</a><a class="tag" taget="_blank" href="/search/kotlin/1.htm">kotlin</a><a class="tag" taget="_blank" href="/search/swift/1.htm">swift</a> <div>目录一、引言二、IconButton的基本用法三、进阶技巧3.1自定义形状与背景3.2带文本的IconButton(使用Column组合)3.3自定义交互反馈3.4动态图标切换3.5组合式按钮(图标+文字)四、高级应用4.1与主题深度整合4.2手势扩展(长按/双击)4.3动画增强点击效果五、性能与最佳实践5.1避免重建5.1.1声明常量图标5.1.2带参数的常量图标5.1.3常量图标按钮5.1.4</div> </li> <li><a href="/article/1902424960203288576.htm" title="基于云效Flow落地自动化构建——构建集群" target="_blank">基于云效Flow落地自动化构建——构建集群</a> <span class="text-muted">云效DevOps平台</span> <a class="tag" taget="_blank" href="/search/%E5%9C%BA%E6%99%AF%E5%AE%9E%E8%B7%B5/1.htm">场景实践</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E6%95%88/1.htm">云效</a><a class="tag" taget="_blank" href="/search/%E4%BA%91%E6%95%88Flow/1.htm">云效Flow</a><a class="tag" taget="_blank" href="/search/%E6%9E%84%E5%BB%BA%E5%99%A8/1.htm">构建器</a><a class="tag" taget="_blank" href="/search/%E6%9E%84%E5%BB%BA%E9%9B%86%E7%BE%A4/1.htm">构建集群</a><a class="tag" taget="_blank" href="/search/%E7%A0%94%E5%8F%91%E5%9B%A2%E9%98%9F/1.htm">研发团队</a><a class="tag" taget="_blank" href="/search/%E7%A0%94%E5%8F%91%E7%AE%A1%E7%90%86/1.htm">研发管理</a> <div>基于云效Flow落地自动化构建,构建集群,云效流水线Flow是持续交付的载体,通过构建自动化、集成自动化、验证自动化、部署自动化,完成从开发到上线过程的持续交付。通过持续向团队提供及时反馈,让交付过程高效顺畅,基于云效Flow自动化构建工具,构建集群操作群指南。立即体验云效构建集群,云效Flow支持用户个性化的构建场景,提供三种类型的构建集群的能力支持。用户在流水线编排时,可以为任务设置不同的构建</div> </li> <li><a href="/article/1902423699139653632.htm" title="施磊老师高级c++(一)" target="_blank">施磊老师高级c++(一)</a> <span class="text-muted">Zhuai-行淮</span> <a class="tag" taget="_blank" href="/search/%E6%96%BD%E7%A3%8A%E8%80%81%E5%B8%88cpp/1.htm">施磊老师cpp</a><a class="tag" taget="_blank" href="/search/c%2B%2B/1.htm">c++</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a> <div>对象被优化后,才是高效的c++编程文章目录对象被优化后,才是高效的c++编程1.对象使用背后调用了哪些方法2.函数调用过程中对象背后调用方法3.总结三条对象优化的规则4.CMyString的代码问题5.添加带右值引用参数的拷贝构造和赋值函数6.String类在vector上的应用--面试题7.move移动语义和forword类型完美转发move移动语义的作用代码:**问题:**解决办法:最终代码:</div> </li> <li><a href="/article/1902422186929483776.htm" title="目前市场上主流的机器视觉的框架有哪些?他们的特点及优劣" target="_blank">目前市场上主流的机器视觉的框架有哪些?他们的特点及优劣</a> <span class="text-muted">yuanpan</span> <a class="tag" taget="_blank" href="/search/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/1.htm">机器学习</a><a class="tag" taget="_blank" href="/search/%E8%AE%A1%E7%AE%97%E6%9C%BA%E8%A7%86%E8%A7%89/1.htm">计算机视觉</a> <div>目前市场上主流的机器视觉框架和工具可以分为商业软件、开源工具和深度学习框架三大类。以下是它们的总结及特点对比:1.商业软件(1)Halcon(MVTec)特点:专注于工业机器视觉,提供高精度、高效率的算法。支持复杂的工业应用,如缺陷检测、3D视觉、深度学习等。提供图形化开发工具HDevelop和多种编程接口。优势:算法优化好,适合实时工业应用。硬件兼容性强,支持多种工业相机和设备。劣势:商业软件,</div> </li> <li><a href="/article/1902422058248237056.htm" title="matsim开发教程" target="_blank">matsim开发教程</a> <span class="text-muted">若木胡</span> <a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a><a class="tag" taget="_blank" href="/search/%E4%BF%A1%E6%81%AF%E5%8F%AF%E8%A7%86%E5%8C%96/1.htm">信息可视化</a> <div>以下是基于MATSim的二次开发教程指南,结合交通仿真框架的核心功能和开发实践,提供从环境搭建到高级开发的完整路径:一、MATSim简介MATSim(Multi-AgentTransportSimulation)是一个基于Java的开源交通仿真框架,专注于大规模多智能体(Agent)交通行为模拟,支持动态需求建模、路径规划优化、政策评估等应用场景。二、开发环境搭建1.基础依赖JavaJDK11+:</div> </li> <li><a href="/article/1902418148880084992.htm" title="1.1PaddleTS_环境配置:一个易用的深度时序建模的Python库" target="_blank">1.1PaddleTS_环境配置:一个易用的深度时序建模的Python库</a> <span class="text-muted">pythonQA</span> <a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/paddlepaddle/1.htm">paddlepaddle</a> <div>PaddleTS是一个易用的深度时序建模的Python库,它基于飞桨深度学习框架PaddlePaddle,专注业界领先的深度模型,旨在为领域专家和行业用户提供可扩展的时序建模能力和便捷易用的用户体验。PaddleTS的主要特性包括:设计统一数据结构,实现对多样化时序数据的表达,支持单目标与多目标变量,支持多类型协变量封装基础模型功能,如数据加载、回调设置、损失函数、训练过程控制等公共方法,帮助开发</div> </li> <li><a href="/article/1902416547855527936.htm" title="深入解析:React中的信号组件与细粒度更新" target="_blank">深入解析:React中的信号组件与细粒度更新</a> <span class="text-muted"></span> <div>引言在主流的前端开发框架中,无论是React、Vue还是Svelte,核心都是围绕着更高效地进行UI渲染展开的。为了实现高性能,基于DOM总是比较慢这个假设前提,其最核心的要解决的问题有两个:响应式更新细粒度更新为了将响应式更新、细粒度更新优化到极致,各种框架是八仙过海,各显神通。以最流行的React和Vue为例,首先两者均引入了VirtualDOM的概念。Vue的静态模板编译,通过编译时的静态分</div> </li> <li><a href="/article/1902412261935345664.htm" title="SvelteKit 最新中文文档教程(6)—— 状态管理" target="_blank">SvelteKit 最新中文文档教程(6)—— 状态管理</a> <span class="text-muted"></span> <div>前言Svelte,一个语法简洁、入门容易,面向未来的前端框架。从Svelte诞生之初,就备受开发者的喜爱,根据统计,从2019年到2024年,连续6年一直是开发者最感兴趣的前端框架No.1:Svelte以其独特的编译时优化机制著称,具有轻量级、高性能、易上手等特性,非常适合构建轻量级Web项目。为了帮助大家学习Svelte,我同时搭建了Svelte最新的中文文档站点。如果需要进阶学习,也可以入手我</div> </li> <li><a href="/article/1902410835003764736.htm" title="Camera常用算法介绍1" target="_blank">Camera常用算法介绍1</a> <span class="text-muted">记录美好</span> <a class="tag" taget="_blank" href="/search/android%E7%9B%B8%E6%9C%BA%E5%AD%A6%E4%B9%A0/1.htm">android相机学习</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a><a class="tag" taget="_blank" href="/search/%E7%BB%8F%E9%AA%8C%E5%88%86%E4%BA%AB/1.htm">经验分享</a><a class="tag" taget="_blank" href="/search/%E6%99%BA%E8%83%BD%E6%89%8B%E6%9C%BA/1.htm">智能手机</a> <div>Camera常用数据格式及算法介绍1二、Camera常用算法介绍2.1基础图像处理算法2.1.1HDR算法2.1.1.1HDR算法概述2.1.1.2发展历程2.1.1.2.1传统多帧合成阶段(2010年代初期)2.1.1.2.2.算法优化阶段(2016-2020年)2.1.1.2.3实时处理阶段(2020年至今)2.1.1.3技术原理2.1.1.3.1多帧采集2.1.1.3.2图像合成2.1.1.</div> </li> <li><a href="/article/1902408942781263872.htm" title="pandas整表写入excel指定位置_pandas操作Excel的常用场景及问题" target="_blank">pandas整表写入excel指定位置_pandas操作Excel的常用场景及问题</a> <span class="text-muted">那个吴小明</span> <div>很多场景下使用pandas就能够胜任手上的excel处理任务,之前写的用python操作具体到excel单元格的方法参考:贺霆:python操作Excel实现自动化报表zhuanlan.zhihu.com现在主要介绍使用pandas读取excel的几种常用场景:一、常规读取importpandasaspdfrompandasimportDataFrame,Seriesimportosos.chdi</div> </li> <li><a href="/article/1902408309026123776.htm" title="Docker安装Nginx并部署vue项目" target="_blank">Docker安装Nginx并部署vue项目</a> <span class="text-muted">sdgiuser</span> <a class="tag" taget="_blank" href="/search/vue.js/1.htm">vue.js</a><a class="tag" taget="_blank" href="/search/docker/1.htm">docker</a><a class="tag" taget="_blank" href="/search/nginx/1.htm">nginx</a> <div>拉取Nginx镜像dockerpullnginx查看本地镜像dockerimages运行容器dockerrun--namenginx-p8080:80-dnginx–namenginx:容器名称。-p8080:80:端口进行映射,将本地8080端口映射到容器内部的80端口。-dnginx:设置容器在在后台一直运行。访问端口通过浏览器可以直接访问8080端口的nginx服务修改配置文件查看容器内部的</div> </li> <li><a href="/article/1902404266467848192.htm" title="单片机中断系统" target="_blank">单片机中断系统</a> <span class="text-muted">C_Xurn</span> <a class="tag" taget="_blank" href="/search/%E5%8D%95%E7%89%87%E6%9C%BA/1.htm">单片机</a><a class="tag" taget="_blank" href="/search/stm32/1.htm">stm32</a> <div>前言:中断系统是单片机非常重要的组成部分,是为了使单片机能够对外部或者内部随机发生的事件实时处理而设置的。一:单片机的概念一个高速主机和一个低俗外设连接时,效率极低,低俗外设工作时无端大量占用CPU时间。一个高速主机和多个低速外设连接时,高速主机无法进行多任务并行处理。此时需引入“中断”。CPU在处理某一事件A时,另一事件B发出请求(中断请求);CPU暂时中断当前的工作,转去处理事件B(中断响应和</div> </li> <li><a href="/article/1902403636709879808.htm" title="普通鼠标的500连击的工具来了!!!" target="_blank">普通鼠标的500连击的工具来了!!!</a> <span class="text-muted">2501_90713682</span> <a class="tag" taget="_blank" href="/search/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%A4%96%E8%AE%BE/1.htm">计算机外设</a> <div>今天介绍的这款软件叫:鼠标录制器,是一款大小只有54K的鼠标连点器,软件是绿色单文件版。抢票,拍牌,摇号都能用上。文末有分享链接在使用先我们先设置快捷键,这样我们在录制和停止录制的时候会更方便。软件使用很简单,首先是录制,点击【录制启停】或者按上面设置的快捷键,然后软件就开始录制。录制完成后在【名称】处,我们可以对此次的录制命个名,这样方便我们下次使用。我们还可以设置播放次数,然后点【播放】即可。</div> </li> <li><a href="/article/1902401117799641088.htm" title="单片机—中断系统" target="_blank">单片机—中断系统</a> <span class="text-muted">落幕</span> <a class="tag" taget="_blank" href="/search/%E5%8D%95%E7%89%87%E6%9C%BA/1.htm">单片机</a><a class="tag" taget="_blank" href="/search/%E5%B5%8C%E5%85%A5%E5%BC%8F%E7%A1%AC%E4%BB%B6/1.htm">嵌入式硬件</a> <div>什么是中断系统?为使得CPU具有对外界紧急事件的实时处理能力而设置的,当CPU正在处理某些事的时候,当外界紧急事件请求,CPU会停止当前的事情,先去处理紧急的事件,处理结束后,在返回处理当前事件,这个过程叫做中断,实现这中功能的部件叫做中断系统。什么是中断源?向CPU发出中断请求的请求源就是中断源什么是中断向量表?中断向量是中断服务(处理)程序的入口地址存储中断服务(处理)程序地址的表格中断流程:</div> </li> <li><a href="/article/1902394939812147200.htm" title="AI 时代,学习 Java 应如何入手?" target="_blank">AI 时代,学习 Java 应如何入手?</a> <span class="text-muted">琢磨先生David</span> <a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a> <div>一、Java的现状:生态繁荣与AI融合的双重机遇在2025年的技术版图中,Java依然稳坐企业级开发的“头把交椅”。根据行业统计,Java在全球企业级应用中的市场份额仍超过65%,尤其在微服务架构、大数据平台和物联网(IoT)领域占据核心地位。随着云原生技术的普及,Java生态正经历新一轮进化:轻量化框架通过无服务器架构优化,启动速度提升300%,内存占用降低50%,使得Java在容器化部署中更具</div> </li> <li><a href="/article/1902390148386058240.htm" title="SelectDB 实时分析性能突出,宝舵成本锐减与性能显著提升的双赢之旅" target="_blank">SelectDB 实时分析性能突出,宝舵成本锐减与性能显著提升的双赢之旅</a> <span class="text-muted">SelectDB技术团队</span> <a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a><a class="tag" taget="_blank" href="/search/%E7%89%A9%E8%81%94%E7%BD%91/1.htm">物联网</a><a class="tag" taget="_blank" href="/search/doris/1.htm">doris</a><a class="tag" taget="_blank" href="/search/selectdb/1.htm">selectdb</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a><a class="tag" taget="_blank" href="/search/%E7%94%B5%E5%95%86%E5%9C%BA%E6%99%AF/1.htm">电商场景</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90/1.htm">数据分析</a> <div>BOCDOP宝舵早期基于TiDB构建实时数仓,随着数据量增长,在数据处理效率、OLAP能力扩展、功能支持、成本与资源方面存在一定优化空间。为提升数据分析能力并优化成本,宝舵引入SelectDB,达成写入速度提升10倍,成本直降30%的显著成效。本文转录自高瑞军(宝尊科技高级架构师)在DorisSummitAsia2024上的演讲,经编辑整理。业务背景宝尊集团创立于2007年,是中国品牌电商服务行业</div> </li> <li><a href="/article/1902386240947286016.htm" title="Python 常用内建模块-base64" target="_blank">Python 常用内建模块-base64</a> <span class="text-muted">赔罪</span> <a class="tag" taget="_blank" href="/search/Python/1.htm">Python</a><a class="tag" taget="_blank" href="/search/%E7%B3%BB%E7%BB%9F%E5%AD%A6%E4%B9%A0/1.htm">系统学习</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/%E5%89%8D%E7%AB%AF/1.htm">前端</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>目录base64小结练习base64Base64是一种用64个字符来表示任意二进制数据的方法。用记事本打开exe、jpg、pdf这些文件时,我们都会看到一大堆乱码,因为二进制文件包含很多无法显示和打印的字符,所以,如果要让记事本这样的文本处理软件能处理二进制数据,就需要一个二进制到字符串的转换方法。Base64是一种最常见的二进制编码方法。Base64的原理很简单,首先,准备一个包含64个字符的数</div> </li> <li><a href="/article/1902385103707893760.htm" title="Win10系统Docker搭建单机Redis环境" target="_blank">Win10系统Docker搭建单机Redis环境</a> <span class="text-muted">夜璨如炽</span> <a class="tag" taget="_blank" href="/search/%E5%AE%B9%E5%99%A8%E9%83%A8%E7%BD%B2/1.htm">容器部署</a><a class="tag" taget="_blank" href="/search/%E7%AC%94%E8%AE%B0/1.htm">笔记</a><a class="tag" taget="_blank" href="/search/docker/1.htm">docker</a><a class="tag" taget="_blank" href="/search/redis/1.htm">redis</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a> <div>一、背景很多时候在本地开发需要快速搭建需要的软件环境,Redis就是常用的开发环境之一,本文主要讲述怎么利用Win10Docker搭建Redis环境。系统:Win1064位Docker:DockerDesktop二、搭建1.准备默认的DockerDesktop镜像服务器在海外,国内的拉取不理想可以考虑更换镜像源。在设置-》DockerEngine-》registry-mirrors一栏添加以下镜像</div> </li> <li><a href="/article/1902383716580257792.htm" title="信创系统安全优化与持续改进策略有哪些?" target="_blank">信创系统安全优化与持续改进策略有哪些?</a> <span class="text-muted">weixin_37579147</span> <a class="tag" taget="_blank" href="/search/%E7%B3%BB%E7%BB%9F%E5%AE%89%E5%85%A8/1.htm">系统安全</a><a class="tag" taget="_blank" href="/search/%E5%AE%89%E5%85%A8/1.htm">安全</a> <div>信创系统(信息技术应用创新系统)的安全优化与持续改进是保障国产化技术生态安全可靠运行的关键。以下从技术、管理、组织等多个维度提出系统性策略,并结合实际场景展开说明:一、技术层面的安全优化策略1.核心组件安全加固国产化组件漏洞管理:建立针对国产操作系统(如统信UOS、麒麟)、数据库(达梦、OceanBase)的漏洞扫描与修复机制,联合厂商建立漏洞情报共享平台。硬件层可信计算:采用基于国产芯片(如鲲鹏</div> </li> <li><a href="/article/1902383329181757440.htm" title="【商城实战(43)】探秘知名商城架构:解锁电商成功密码" target="_blank">【商城实战(43)】探秘知名商城架构:解锁电商成功密码</a> <span class="text-muted">奔跑吧邓邓子</span> <a class="tag" taget="_blank" href="/search/%E5%95%86%E5%9F%8E%E5%AE%9E%E6%88%98/1.htm">商城实战</a><a class="tag" taget="_blank" href="/search/%E6%9E%B6%E6%9E%84/1.htm">架构</a><a class="tag" taget="_blank" href="/search/%E5%BE%AE%E6%9C%8D%E5%8A%A1/1.htm">微服务</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/boot/1.htm">boot</a><a class="tag" taget="_blank" href="/search/%E5%95%86%E5%9F%8E%E5%AE%9E%E6%88%98/1.htm">商城实战</a><a class="tag" taget="_blank" href="/search/%E5%95%86%E5%9F%8E%E6%9E%B6%E6%9E%84/1.htm">商城架构</a> <div>【商城实战】专栏重磅来袭!这是一份专为开发者与电商从业者打造的超详细指南。从项目基础搭建,运用uniapp、ElementPlus、SpringBoot搭建商城框架,到用户、商品、订单等核心模块开发,再到性能优化、安全加固、多端适配,乃至运营推广策略,102章内容层层递进。无论是想深入钻研技术细节,还是探寻商城运营之道,本专栏都能提供从0到1的系统讲解,助力你打造独具竞争力的电商平台,开启电商实战</div> </li> <li><a href="/article/1902378793721458688.htm" title="NL2SQL 优化之 Schema 编写标准" target="_blank">NL2SQL 优化之 Schema 编写标准</a> <span class="text-muted">kakaZhui</span> <a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a><a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E5%BA%93/1.htm">数据库</a><a class="tag" taget="_blank" href="/search/AIGC/1.htm">AIGC</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/llama/1.htm">llama</a><a class="tag" taget="_blank" href="/search/chatgpt/1.htm">chatgpt</a> <div>写在前面在自然语言转SQL(NL2SQL,或Text-to-SQL)任务中,数据库Schema的质量和表示方式对模型的性能有着至关重要的影响。一个清晰、规范、易于理解的Schema能够帮助模型更好地理解数据库结构,从而生成更准确的SQL查询。相反,一个混乱、不规范的Schema会增加模型的理解难度,导致生成的SQL查询错误百出。本文将深入探讨NL2SQL任务中Schema的编写标准,详细介绍如何为</div> </li> <li><a href="/article/1902371360055816192.htm" title="2025年计算机毕业设计springboot 智慧社区管理系统" target="_blank">2025年计算机毕业设计springboot 智慧社区管理系统</a> <span class="text-muted">zhihao503</span> <a class="tag" taget="_blank" href="/search/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/1.htm">课程设计</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/boot/1.htm">boot</a><a class="tag" taget="_blank" href="/search/%E5%90%8E%E7%AB%AF/1.htm">后端</a> <div>本系统(程序+源码)带文档lw万字以上文末可获取一份本项目的java源码和数据库参考。系统程序文件列表开题报告内容选题背景关于智慧社区管理系统的研究,现有成果多聚焦于单一功能模块的数字化(如物业缴费或门禁系统),缺乏对多场景服务整合与用户体验优化的系统性研究。国外研究侧重物联网技术应用(如新加坡“智慧国”计划中的社区传感器网络),而国内研究更多关注管理平台的基础框架设计,但针对业主、物业、设备多方</div> </li> <li><a href="/article/1902369844171436032.htm" title="庖丁解牛:CANoe开发从入门到精通 4 - 1测量与分析窗口 Measurement Setup 2" target="_blank">庖丁解牛:CANoe开发从入门到精通 4 - 1测量与分析窗口 Measurement Setup 2</a> <span class="text-muted">代码悟者:算法之外的智慧</span> <a class="tag" taget="_blank" href="/search/%E7%BD%91%E7%BB%9C/1.htm">网络</a> <div>庖丁解牛:CANoe开发从入门到精通4-1测量与分析窗口MeasurementSetup2第4章CANoe开发从入门到精通4-1测量与分析窗口2文章目录庖丁解牛:CANoe开发从入门到精通4-1测量与分析窗口MeasurementSetup2第4章CANoe开发从入门到精通4-1测量与分析窗口2前言日志文件设置前言目标:掌握测量分析窗口相关知识!口诀:慢慢来,干中学么!日志文件设置格式选择:BLF</div> </li> <li><a href="/article/1902369842158170112.htm" title="flink从kafka读取数据写入clickhouse本地表的实现" target="_blank">flink从kafka读取数据写入clickhouse本地表的实现</a> <span class="text-muted">Breatrice_li</span> <a class="tag" taget="_blank" href="/search/kafka/1.htm">kafka</a><a class="tag" taget="_blank" href="/search/flink/1.htm">flink</a><a class="tag" taget="_blank" href="/search/%E5%88%86%E5%B8%83%E5%BC%8F/1.htm">分布式</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a> <div>实现功能因为直接写clickhouse的分布式表在数据量比较大的时候会有各种问题,所以做了一个flink读取kafka数据然后路由写入到相应的本地表节点,并且关于不同的表的配置信息可以随时更改并设置生效时间。实现流程首先从kafka将数据读取过来然后进行相应的处理及逻辑判断写入到对应的clickhouse表格中最后根据CDC读取来的配置信息进行相应节点的hash路由,直接写入本地表读取kafka数</div> </li> <li><a href="/article/1902365555495596032.htm" title="使用 Redis 实现手机号验证码登陆功能,实际开发中使用 Token 实现登录校验又是如何做的?" target="_blank">使用 Redis 实现手机号验证码登陆功能,实际开发中使用 Token 实现登录校验又是如何做的?</a> <span class="text-muted">程序猿ZhangSir</span> <a class="tag" taget="_blank" href="/search/Java/1.htm">Java</a><a class="tag" taget="_blank" href="/search/Spring%E5%85%A8%E5%AE%B6%E6%A1%B6/1.htm">Spring全家桶</a><a class="tag" taget="_blank" href="/search/%E5%BE%AE%E6%9C%8D%E5%8A%A1/1.htm">微服务</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/bootstrap/1.htm">bootstrap</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a> <div>目录一.使用Redis实现短信登陆功能1.1前言1.2简要分析短信登陆的业务流程1.3代码书写1.4页面展示效果1.5代码优化1.6优化之后的代码二.登录Token2.1JWT简介2.2JWT的使用方式2.3返回token2.4JWT的校验方式一.使用Redis实现短信登陆功能1.1前言对于我们用户来讲,我们在登陆一个APP的时候,有很多种登陆方式,比如"微信扫码"、"手机号登陆"、"支付宝扫码"</div> </li> <li><a href="/article/1902363912561553408.htm" title="Kafka 数据写入问题" target="_blank">Kafka 数据写入问题</a> <span class="text-muted">喝醉酒的小白</span> <a class="tag" taget="_blank" href="/search/DBA/1.htm">DBA</a><a class="tag" taget="_blank" href="/search/kafka/1.htm">kafka</a><a class="tag" taget="_blank" href="/search/%E5%88%86%E5%B8%83%E5%BC%8F/1.htm">分布式</a> <div>目录标题分析思路1.**生产者配置问题**:Kafka生产者的配置参数生产者和消费者的处理确定并优化2.**网络问题**:3.**Kafka集群配置问题**:unclean.leader.election.enable4.**Zookeeper配置问题**:5.**JVM参数调优**:6.**副本因子和同步复制**:分析思路针对您提到的Kafka数据写入问题,以下是一些具体的原因和排查命令:1.生</div> </li> <li><a href="/article/1902363913199087616.htm" title="微信小程序面试内容整理-图片优化" target="_blank">微信小程序面试内容整理-图片优化</a> <span class="text-muted">不务正业的猿</span> <a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95/1.htm">面试</a><a class="tag" taget="_blank" href="/search/%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F/1.htm">微信小程序</a><a class="tag" taget="_blank" href="/search/%E5%89%8D%E7%AB%AF/1.htm">前端</a><a class="tag" taget="_blank" href="/search/%E5%BE%AE%E4%BF%A1%E5%B0%8F%E7%A8%8B%E5%BA%8F/1.htm">微信小程序</a><a class="tag" taget="_blank" href="/search/notepad%2B%2B/1.htm">notepad++</a><a class="tag" taget="_blank" href="/search/%E5%B0%8F%E7%A8%8B%E5%BA%8F/1.htm">小程序</a><a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95/1.htm">面试</a><a class="tag" taget="_blank" href="/search/%E8%81%8C%E5%9C%BA%E5%92%8C%E5%8F%91%E5%B1%95/1.htm">职场和发展</a> <div>在微信小程序中,图片优化是提升加载速度、节省网络带宽和提高用户体验的重要步骤。图片通常是小程序页面中的主要资源,合理的图片优化能显著提高小程序的性能,尤其是在用户网络状况较差的情况下。1.选择合适的图片格式不同的图片格式有不同的特点,选择合适的格式能够有效减小图片的大小,同时保证图片质量。</div> </li> <li><a href="/article/1902362272978759680.htm" title="AIGC时代品牌突围战:10招玩转DeepSeek内容推荐(深度扩展版)" target="_blank">AIGC时代品牌突围战:10招玩转DeepSeek内容推荐(深度扩展版)</a> <span class="text-muted">白雪讲堂</span> <a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a><a class="tag" taget="_blank" href="/search/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/1.htm">机器学习</a> <div>一、认知革命:从SEO到GEO的生死迭代案例对比:传统SEO困境:某家电品牌2023年投入200万SEO优化,关键词排名TOP3但流量下降42%(SEMrush数据)GEO突破案例:某母婴品牌通过结构化数据改造,AI推荐量从日均300次飙升至1.2万次(来源:DeepSeek官方案例库)实战要点:内容形态改造:将产品参数表升级为JSON-LD格式(某手机品牌实现参数类问题100%引用)流量分配逻辑</div> </li> <li><a href="/article/1902360760311410688.htm" title="列出0 racle Forms配置文件?思维导图 代码示例(java 架构)" target="_blank">列出0 racle Forms配置文件?思维导图 代码示例(java 架构)</a> <span class="text-muted">用心去追梦</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E6%9E%B6%E6%9E%84/1.htm">架构</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a> <div>OracleForms配置文件OracleForms应用程序的配置涉及到多个文件,这些文件用于定义运行时环境、数据库连接、安全设置等。以下是与OracleForms相关的常见配置文件:1.formsweb.cfg位置:通常位于/forms/server/formsweb.cfg或WebLogic域中的指定目录。用途:此文件包含启动Forms应用所需的各种参数和属性,如表单模块名称、数据库连接字符串</div> </li> <li><a href="/article/18.htm" title="jQuery 跨域访问的三种方式 No 'Access-Control-Allow-Origin' header is present on the reque" target="_blank">jQuery 跨域访问的三种方式 No 'Access-Control-Allow-Origin' header is present on the reque</a> <span class="text-muted">qiaolevip</span> <a class="tag" taget="_blank" href="/search/%E6%AF%8F%E5%A4%A9%E8%BF%9B%E6%AD%A5%E4%B8%80%E7%82%B9%E7%82%B9/1.htm">每天进步一点点</a><a class="tag" taget="_blank" href="/search/%E5%AD%A6%E4%B9%A0%E6%B0%B8%E6%97%A0%E6%AD%A2%E5%A2%83/1.htm">学习永无止境</a><a class="tag" taget="_blank" href="/search/%E8%B7%A8%E5%9F%9F/1.htm">跨域</a><a class="tag" taget="_blank" href="/search/%E4%BC%97%E8%A7%82%E5%8D%83%E8%B1%A1/1.htm">众观千象</a> <div>XMLHttpRequest cannot load http://v.xxx.com. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63342' is therefore not allowed access. test.html:1 </div> </li> <li><a href="/article/145.htm" title="mysql 分区查询优化" target="_blank">mysql 分区查询优化</a> <span class="text-muted">annan211</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E5%88%86%E5%8C%BA/1.htm">分区</a><a class="tag" taget="_blank" href="/search/%E4%BC%98%E5%8C%96/1.htm">优化</a><a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a> <div> 分区查询优化 引入分区可以给查询带来一定的优势,但同时也会引入一些bug. 分区最大的优点就是优化器可以根据分区函数来过滤掉一些分区,通过分区过滤可以让查询扫描更少的数据。 所以,对于访问分区表来说,很重要的一点是要在where 条件中带入分区,让优化器过滤掉无需访问的分区。 可以通过查看explain执行计划,是否携带 partitions</div> </li> <li><a href="/article/272.htm" title="MYSQL存储过程中使用游标" target="_blank">MYSQL存储过程中使用游标</a> <span class="text-muted">chicony</span> <a class="tag" taget="_blank" href="/search/Mysql%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B/1.htm">Mysql存储过程</a> <div>DELIMITER $$ DROP PROCEDURE IF EXISTS getUserInfo $$ CREATE PROCEDURE getUserInfo(in date_day datetime)-- -- 实例-- 存储过程名为:getUserInfo-- 参数为:date_day日期格式:2008-03-08--    BEGINdecla</div> </li> <li><a href="/article/399.htm" title="mysql 和 sqlite 区别" target="_blank">mysql 和 sqlite 区别</a> <span class="text-muted">Array_06</span> <a class="tag" taget="_blank" href="/search/sqlite/1.htm">sqlite</a> <div>转载: http://www.cnblogs.com/ygm900/p/3460663.html mysql 和 sqlite 区别 SQLITE是单机数据库。功能简约,小型化,追求最大磁盘效率 MYSQL是完善的服务器数据库。功能全面,综合化,追求最大并发效率 MYSQL、Sybase、Oracle等这些都是试用于服务器数据量大功能多需要安装,例如网站访问量比较大的。而sq</div> </li> <li><a href="/article/526.htm" title="pinyin4j使用" target="_blank">pinyin4j使用</a> <span class="text-muted">oloz</span> <a class="tag" taget="_blank" href="/search/pinyin4j/1.htm">pinyin4j</a> <div>首先需要pinyin4j的jar包支持;jar包已上传至附件内 方法一:把汉字转换为拼音;例如:编程转换后则为biancheng      /** * 将汉字转换为全拼 * @param src 你的需要转换的汉字 * @param isUPPERCASE 是否转换为大写的拼音; true:转换为大写;fal</div> </li> <li><a href="/article/653.htm" title="微博发送私信" target="_blank">微博发送私信</a> <span class="text-muted">随意而生</span> <a class="tag" taget="_blank" href="/search/%E5%BE%AE%E5%8D%9A/1.htm">微博</a> <div>在前面文章中说了如和获取登陆时候所需要的cookie,现在只要拿到最后登陆所需要的cookie,然后抓包分析一下微博私信发送界面 http://weibo.com/message/history?uid=****&name=**** 可以发现其发送提交的Post请求和其中的数据, 让后用程序模拟发送POST请求中的数据,带着cookie发送到私信的接入口,就可以实现发私信的功能了。 </div> </li> <li><a href="/article/780.htm" title="jsp" target="_blank">jsp</a> <span class="text-muted">香水浓</span> <a class="tag" taget="_blank" href="/search/jsp/1.htm">jsp</a> <div>JSP初始化     容器载入JSP文件后,它会在为请求提供任何服务前调用jspInit()方法。如果您需要执行自定义的JSP初始化任务,复写jspInit()方法就行了 JSP执行     这一阶段描述了JSP生命周期中一切与请求相关的交互行为,直到被销毁。     当JSP网页完成初始化后</div> </li> <li><a href="/article/907.htm" title="在 Windows 上安装 SVN Subversion 服务端" target="_blank">在 Windows 上安装 SVN Subversion 服务端</a> <span class="text-muted">AdyZhang</span> <a class="tag" taget="_blank" href="/search/SVN/1.htm">SVN</a> <div>在 Windows 上安装 SVN Subversion 服务端2009-09-16高宏伟哈尔滨市道里区通达街291号   最佳阅读效果请访问原地址:http://blog.donews.com/dukejoe/archive/2009/09/16/1560917.aspx   现在的Subversion已经足够稳定,而且已经进入了它的黄金时段。我们看到大量的项目都在使</div> </li> <li><a href="/article/1034.htm" title="android开发中如何使用 alertDialog从listView中删除数据?" target="_blank">android开发中如何使用 alertDialog从listView中删除数据?</a> <span class="text-muted">aijuans</span> <a class="tag" taget="_blank" href="/search/android/1.htm">android</a> <div>我现在使用listView展示了很多的配置信息,我现在想在点击其中一条的时候填出 alertDialog,点击确认后就删除该条数据,( ArrayAdapter ,ArrayList,listView 全部删除),我知道在 下面的onItemLongClick 方法中 参数 arg2  是选中的序号,但是我不知道如何继续处理下去 1 2 3 </div> </li> <li><a href="/article/1161.htm" title="jdk-6u26-linux-x64.bin 安装" target="_blank">jdk-6u26-linux-x64.bin 安装</a> <span class="text-muted">baalwolf</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>1.上传安装文件(jdk-6u26-linux-x64.bin) 2.修改权限 [root@localhost ~]# ls -l /usr/local/jdk-6u26-linux-x64.bin 3.执行安装文件 [root@localhost ~]# cd /usr/local [root@localhost local]# ./jdk-6u26-linux-x64.bin&nbs</div> </li> <li><a href="/article/1288.htm" title="MongoDB经典面试题集锦" target="_blank">MongoDB经典面试题集锦</a> <span class="text-muted">BigBird2012</span> <a class="tag" taget="_blank" href="/search/mongodb/1.htm">mongodb</a> <div>1.什么是NoSQL数据库?NoSQL和RDBMS有什么区别?在哪些情况下使用和不使用NoSQL数据库? NoSQL是非关系型数据库,NoSQL = Not Only SQL。 关系型数据库采用的结构化的数据,NoSQL采用的是键值对的方式存储数据。 在处理非结构化/半结构化的大数据时;在水平方向上进行扩展时;随时应对动态增加的数据项时可以优先考虑使用NoSQL数据库。 在考虑数据库的成熟</div> </li> <li><a href="/article/1415.htm" title="JavaScript异步编程Promise模式的6个特性" target="_blank">JavaScript异步编程Promise模式的6个特性</a> <span class="text-muted">bijian1013</span> <a class="tag" taget="_blank" href="/search/JavaScript/1.htm">JavaScript</a><a class="tag" taget="_blank" href="/search/Promise/1.htm">Promise</a> <div>        Promise是一个非常有价值的构造器,能够帮助你避免使用镶套匿名方法,而使用更具有可读性的方式组装异步代码。这里我们将介绍6个最简单的特性。         在我们开始正式介绍之前,我们想看看Javascript Promise的样子: var p = new Promise(function(r</div> </li> <li><a href="/article/1542.htm" title="[Zookeeper学习笔记之八]Zookeeper源代码分析之Zookeeper.ZKWatchManager" target="_blank">[Zookeeper学习笔记之八]Zookeeper源代码分析之Zookeeper.ZKWatchManager</a> <span class="text-muted">bit1129</span> <a class="tag" taget="_blank" href="/search/zookeeper/1.htm">zookeeper</a> <div>ClientWatchManager接口 //接口的唯一方法materialize用于确定那些Watcher需要被通知 //确定Watcher需要三方面的因素1.事件状态 2.事件类型 3.znode的path public interface ClientWatchManager { /** * Return a set of watchers that should</div> </li> <li><a href="/article/1669.htm" title="【Scala十五】Scala核心九:隐式转换之二" target="_blank">【Scala十五】Scala核心九:隐式转换之二</a> <span class="text-muted">bit1129</span> <a class="tag" taget="_blank" href="/search/scala/1.htm">scala</a> <div>隐式转换存在的必要性,   在Java Swing中,按钮点击事件的处理,转换为Scala的的写法如下:   val button = new JButton button.addActionListener( new ActionListener { def actionPerformed(event: ActionEvent) { </div> </li> <li><a href="/article/1796.htm" title="Android JSON数据的解析与封装小Demo" target="_blank">Android JSON数据的解析与封装小Demo</a> <span class="text-muted">ronin47</span> <div>转自:http://www.open-open.com/lib/view/open1420529336406.html package com.example.jsondemo; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject;    impor</div> </li> <li><a href="/article/1923.htm" title="[设计]字体创意设计方法谈" target="_blank">[设计]字体创意设计方法谈</a> <span class="text-muted">brotherlamp</span> <a class="tag" taget="_blank" href="/search/UI/1.htm">UI</a><a class="tag" taget="_blank" href="/search/ui%E8%87%AA%E5%AD%A6/1.htm">ui自学</a><a class="tag" taget="_blank" href="/search/ui%E8%A7%86%E9%A2%91/1.htm">ui视频</a><a class="tag" taget="_blank" href="/search/ui%E6%95%99%E7%A8%8B/1.htm">ui教程</a><a class="tag" taget="_blank" href="/search/ui%E8%B5%84%E6%96%99/1.htm">ui资料</a> <div>  从古至今,文字在我们的生活中是必不可少的事物,我们不能想象没有文字的世界将会是怎样。在平面设计中,UI设计师在文字上所花的心思和功夫最多,因为文字能直观地表达UI设计师所的意念。在文字上的创造设计,直接反映出平面作品的主题。 如设计一幅戴尔笔记本电脑的广告海报,假设海报上没有出现“戴尔”两个文字,即使放上所有戴尔笔记本电脑的图片都不能让人们得知这些电脑是什么品牌。只要写上“戴尔笔</div> </li> <li><a href="/article/2050.htm" title="单调队列-用一个长度为k的窗在整数数列上移动,求窗里面所包含的数的最大值" target="_blank">单调队列-用一个长度为k的窗在整数数列上移动,求窗里面所包含的数的最大值</a> <span class="text-muted">bylijinnan</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a><a class="tag" taget="_blank" href="/search/%E9%9D%A2%E8%AF%95%E9%A2%98/1.htm">面试题</a> <div>import java.util.LinkedList; /* 单调队列 滑动窗口 单调队列是这样的一个队列:队列里面的元素是有序的,是递增或者递减 题目:给定一个长度为N的整数数列a(i),i=0,1,...,N-1和窗长度k. 要求:f(i) = max{a(i-k+1),a(i-k+2),..., a(i)},i = 0,1,...,N-1 问题的另一种描述就</div> </li> <li><a href="/article/2177.htm" title="struts2处理一个form多个submit" target="_blank">struts2处理一个form多个submit</a> <span class="text-muted">chiangfai</span> <a class="tag" taget="_blank" href="/search/struts2/1.htm">struts2</a> <div>web应用中,为完成不同工作,一个jsp的form标签可能有多个submit。如下代码: <s:form action="submit" method="post" namespace="/my"> <s:textfield name="msg" label="叙述:"></div> </li> <li><a href="/article/2304.htm" title="shell查找上个月,陷阱及野路子" target="_blank">shell查找上个月,陷阱及野路子</a> <span class="text-muted">chenchao051</span> <a class="tag" taget="_blank" href="/search/shell/1.htm">shell</a> <div>date -d "-1 month" +%F     以上这段代码,假如在2012/10/31执行,结果并不会出现你预计的9月份,而是会出现八月份,原因是10月份有31天,9月份30天,所以-1 month在10月份看来要减去31天,所以直接到了8月31日这天,这不靠谱。     野路子解决:假设当天日期大于15号</div> </li> <li><a href="/article/2431.htm" title="mysql导出数据中文乱码问题" target="_blank">mysql导出数据中文乱码问题</a> <span class="text-muted">daizj</span> <a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a><a class="tag" taget="_blank" href="/search/%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81/1.htm">中文乱码</a><a class="tag" taget="_blank" href="/search/%E5%AF%BC%E6%95%B0%E6%8D%AE/1.htm">导数据</a> <div>解决mysql导入导出数据乱码问题方法: 1、进入mysql,通过如下命令查看数据库编码方式: mysql>  show variables like 'character_set_%'; +--------------------------+----------------------------------------+ | Variable_name&nbs</div> </li> <li><a href="/article/2558.htm" title="SAE部署Smarty出现:Uncaught exception 'SmartyException' with message 'unable to write" target="_blank">SAE部署Smarty出现:Uncaught exception 'SmartyException' with message 'unable to write</a> <span class="text-muted">dcj3sjt126com</span> <a class="tag" taget="_blank" href="/search/PHP/1.htm">PHP</a><a class="tag" taget="_blank" href="/search/smarty/1.htm">smarty</a><a class="tag" taget="_blank" href="/search/sae/1.htm">sae</a> <div>  对于SAE出现的问题:Uncaught exception 'SmartyException' with message 'unable to write file...。 官方给出了详细的FAQ:http://sae.sina.com.cn/?m=faqs&catId=11#show_213 解决方案为:   01 $path </div> </li> <li><a href="/article/2685.htm" title="《教父》系列台词" target="_blank">《教父》系列台词</a> <span class="text-muted">dcj3sjt126com</span> <div>Your love is also your weak point. 你的所爱同时也是你的弱点。   If anything in this life is certain, if history has taught us anything, it is that you can kill anyone.   不顾家的人永远不可能成为一个真正的男人。 &</div> </li> <li><a href="/article/2812.htm" title="mongodb安装与使用" target="_blank">mongodb安装与使用</a> <span class="text-muted">dyy_gusi</span> <a class="tag" taget="_blank" href="/search/mongo/1.htm">mongo</a> <div>一.MongoDB安装和启动,widndows和linux基本相同 1.下载数据库,     linux:mongodb-linux-x86_64-ubuntu1404-3.0.3.tgz 2.解压文件,并且放置到合适的位置     tar -vxf mongodb-linux-x86_64-ubun</div> </li> <li><a href="/article/2939.htm" title="Git排除目录" target="_blank">Git排除目录</a> <span class="text-muted">geeksun</span> <a class="tag" taget="_blank" href="/search/git/1.htm">git</a> <div>在Git的版本控制中,可能有些文件是不需要加入控制的,那我们在提交代码时就需要忽略这些文件,下面讲讲应该怎么给Git配置一些忽略规则。   有三种方法可以忽略掉这些文件,这三种方法都能达到目的,只不过适用情景不一样。 1.  针对单一工程排除文件 这种方式会让这个工程的所有修改者在克隆代码的同时,也能克隆到过滤规则,而不用自己再写一份,这就能保证所有修改者应用的都是同一</div> </li> <li><a href="/article/3066.htm" title="Ubuntu 创建开机自启动脚本的方法" target="_blank">Ubuntu 创建开机自启动脚本的方法</a> <span class="text-muted">hongtoushizi</span> <a class="tag" taget="_blank" href="/search/ubuntu/1.htm">ubuntu</a> <div>转载自: http://rongjih.blog.163.com/blog/static/33574461201111504843245/ Ubuntu 创建开机自启动脚本的步骤如下: 1) 将你的启动脚本复制到 /etc/init.d目录下 以下假设你的脚本文件名为 test。   2) 设置脚本文件的权限 $ sudo chmod 755</div> </li> <li><a href="/article/3193.htm" title="第八章 流量复制/AB测试/协程" target="_blank">第八章 流量复制/AB测试/协程</a> <span class="text-muted">jinnianshilongnian</span> <a class="tag" taget="_blank" href="/search/nginx/1.htm">nginx</a><a class="tag" taget="_blank" href="/search/lua/1.htm">lua</a><a class="tag" taget="_blank" href="/search/coroutine/1.htm">coroutine</a> <div>流量复制 在实际开发中经常涉及到项目的升级,而该升级不能简单的上线就完事了,需要验证该升级是否兼容老的上线,因此可能需要并行运行两个项目一段时间进行数据比对和校验,待没问题后再进行上线。这其实就需要进行流量复制,把流量复制到其他服务器上,一种方式是使用如tcpcopy引流;另外我们还可以使用nginx的HttpLuaModule模块中的ngx.location.capture_multi进行并发</div> </li> <li><a href="/article/3320.htm" title="电商系统商品表设计" target="_blank">电商系统商品表设计</a> <span class="text-muted">lkl</span> <div>DROP TABLE IF EXISTS `category`; -- 类目表 /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `category` ( `id` int(11) NOT NUL</div> </li> <li><a href="/article/3447.htm" title="修改phpMyAdmin导入SQL文件的大小限制" target="_blank">修改phpMyAdmin导入SQL文件的大小限制</a> <span class="text-muted">pda158</span> <a class="tag" taget="_blank" href="/search/sql/1.htm">sql</a><a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a> <div> 用phpMyAdmin导入mysql数据库时,我的10M的 数据库不能导入,提示mysql数据库最大只能导入2M。    phpMyAdmin数据库导入出错:   You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit. </div> </li> <li><a href="/article/3574.htm" title="Tomcat性能调优方案" target="_blank">Tomcat性能调优方案</a> <span class="text-muted">Sobfist</span> <a class="tag" taget="_blank" href="/search/apache/1.htm">apache</a><a class="tag" taget="_blank" href="/search/jvm/1.htm">jvm</a><a class="tag" taget="_blank" href="/search/tomcat/1.htm">tomcat</a><a class="tag" taget="_blank" href="/search/%E5%BA%94%E7%94%A8%E6%9C%8D%E5%8A%A1%E5%99%A8/1.htm">应用服务器</a> <div>一、操作系统调优 对于操作系统优化来说,是尽可能的增大可使用的内存容量、提高CPU的频率,保证文件系统的读写速率等。经过压力测试验证,在并发连接很多的情况下,CPU的处理能力越强,系统运行速度越快。。 【适用场景】 任何项目。 二、Java虚拟机调优 应该选择SUN的JVM,在满足项目需要的前提下,尽量选用版本较高的JVM,一般来说高版本产品在速度和效率上比低版本会有改进。 J</div> </li> <li><a href="/article/3701.htm" title="SQLServer学习笔记" target="_blank">SQLServer学习笔记</a> <span class="text-muted">vipbooks</span> <a class="tag" taget="_blank" href="/search/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/1.htm">数据结构</a><a class="tag" taget="_blank" href="/search/xml/1.htm">xml</a> <div>1、create database school 创建数据库school 2、drop database school 删除数据库school 3、use school 连接到school数据库,使其成为当前数据库 4、create table class(classID int primary key identity not null) 创建一个名为class的表,其有一</div> </li> </ul> </div> </div> </div> <div> <div class="container"> <div class="indexes"> <strong>按字母分类:</strong> <a href="/tags/A/1.htm" target="_blank">A</a><a href="/tags/B/1.htm" target="_blank">B</a><a href="/tags/C/1.htm" target="_blank">C</a><a href="/tags/D/1.htm" target="_blank">D</a><a href="/tags/E/1.htm" target="_blank">E</a><a href="/tags/F/1.htm" target="_blank">F</a><a href="/tags/G/1.htm" target="_blank">G</a><a href="/tags/H/1.htm" target="_blank">H</a><a href="/tags/I/1.htm" target="_blank">I</a><a href="/tags/J/1.htm" target="_blank">J</a><a href="/tags/K/1.htm" target="_blank">K</a><a href="/tags/L/1.htm" target="_blank">L</a><a href="/tags/M/1.htm" target="_blank">M</a><a href="/tags/N/1.htm" target="_blank">N</a><a href="/tags/O/1.htm" target="_blank">O</a><a href="/tags/P/1.htm" target="_blank">P</a><a href="/tags/Q/1.htm" target="_blank">Q</a><a href="/tags/R/1.htm" target="_blank">R</a><a href="/tags/S/1.htm" target="_blank">S</a><a href="/tags/T/1.htm" target="_blank">T</a><a href="/tags/U/1.htm" target="_blank">U</a><a href="/tags/V/1.htm" target="_blank">V</a><a href="/tags/W/1.htm" target="_blank">W</a><a href="/tags/X/1.htm" target="_blank">X</a><a href="/tags/Y/1.htm" target="_blank">Y</a><a href="/tags/Z/1.htm" target="_blank">Z</a><a href="/tags/0/1.htm" target="_blank">其他</a> </div> </div> </div> <footer id="footer" class="mb30 mt30"> <div class="container"> <div class="footBglm"> <a target="_blank" href="/">首页</a> - <a target="_blank" href="/custom/about.htm">关于我们</a> - <a target="_blank" href="/search/Java/1.htm">站内搜索</a> - <a target="_blank" href="/sitemap.txt">Sitemap</a> - <a target="_blank" href="/custom/delete.htm">侵权投诉</a> </div> <div class="copyright">版权所有 IT知识库 CopyRight © 2000-2050 E-COM-NET.COM , All Rights Reserved. <!-- <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">京ICP备09083238号</a><br>--> </div> </div> </footer> <!-- 代码高亮 --> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shCore.js"></script> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shLegacy.js"></script> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shAutoloader.js"></script> <link type="text/css" rel="stylesheet" href="/static/syntaxhighlighter/styles/shCoreDefault.css"/> <script type="text/javascript" src="/static/syntaxhighlighter/src/my_start_1.js"></script> </body> </html>