Age | Commit message (Collapse) | Author |
|
|
|
|
|
In preparation for work on progressive loading, update the exception
handling scheme slightly.
Until now, exceptions (as thrown with fz_throw, and caught with
fz_try/fz_catch) have merely had an informative string. They have
never had anything that can be compared to see if an error is of
a particular type.
We now introduce error codes; when we fz_throw, we now always
give an error code, and can optionally (using fz_throw_message)
give both an error code and an informative string.
When we fz_rethrow from within a fz_catch, both the error code and
the error message is maintained. Using fz_rethrow_message we can
'improve' the error message, but the code is maintained.
The error message can be read out using fz_caught_message() and the
error code can be read as fz_caught().
Currently we only define a 'generic' error. This will expand in future
versions to include other error types that may be tested for.
|
|
|
|
|
|
|
|
|
|
|
|
Tested with msysgit 1.8.3 environment.
|
|
Remove fz_free_display_list from the API; instead use fz_drop_display_list.
|
|
|
|
|
|
|
|
|
|
|
|
Mono only for now. Copy the appropriate fz_pcl_options for the printer required
and pass that to fz_write_pcl_bitmap.
Add pcl output to mudraw - .pcl produces laserjet 4 compatible pcl.
|
|
* pdfapp_save in pdfapp.c contains unreachable code (and could be
simplified by inverting most of the checked conditions)
* RegSetValueExA expects a const BYTE pointer instead of a char
pointer (warns about signedness mismatch)
* same for SendMessageA where -1 is signed even though WPARAM isn't
Also, there's no need to include mupdf.h, muxps.h, etc. at the top of
applications which only use the fz_* API (fitz.h comes included with
pdfapp.h).
|
|
Colorspace changes in mudraw had broken svg output.
|
|
|
|
Avoid all direct access to the xref table so that the impementation can
be altered to add new features
|
|
|
|
|
|
|
|
|
|
|
|
This should (pretty much) give us enough to write a mupdftoraster
equivalent of gstoraster.
|
|
To prepare for color management, we have to make the device colorspaces
per-context and able to be overridden by users.
|
|
|
|
No font support (just font names are sent through).
No group support.
No shading support.
No image mask support.
Line art, text position/size, bitmaps, clipping all seem to work
though.
|
|
|
|
|
|
|
|
Now can open jpeg/png/tiff files within mupdf.
|
|
For better interoperability with non-unix-y apps that don't know about
selection and middle-click paste, add the ability to use Ctl+C to copy
the selected text to the clipboard.
Thanks to Sebras for original patch.
|
|
|
|
2 more memory problems pointed out by mhfan - many thanks.
In the text device, run through the line height list to it's length,
not to it's capacity.
In the X11 image code, when copying data unchanged, copy whole ints,
not just the first quarter of the bytes.
|
|
Rename fz_new_output_buffer to be fz_new_output_with_buffer.
Rename fz_new_output_file to be fz_new_output_with_file.
This is more consistent with other functions such as
fz_new_pixmap_with_data.
|
|
When I added transition handling to mupdf, I broke the X11
behaviour of coalescing all events and only blitting when
idle.
This commit restores that behaviour, except when transitions
are actually in progress (when it still blits instantly).
|
|
Add configuration functions to control the hints set on a given device.
Use this to set whether image data is captured or not in the text
extraction process.
Also update the display list device to respect the device hints during
playback.
|
|
Extract such records as part of the text device.
|
|
|
|
The "-G gamma" entry in the usage string was different in style to
all the other entries.
|
|
The div/spans still use table style rendering, but it's simpler
code (and html) this way.
|
|
Rework the text extraction structures - the broad strokes are similar
but we now hold more information at each stage to enable us to perform
more detailed analysis on the structure of the page.
We now hold:
fz_text_char's (the position, ucs value, and style of each char).
fz_text_span's (sets of chars that share the same baseline/transform,
with no more than an expected amount of whitespace between each char).
fz_text_line's (sets of spans that share the same baseline (more or
less, allowing for super/subscript, but possibly with a larger than
expected amount of whitespace).
fz_text_block's (sets of lines that follow one another)
After fz_text_analysis is called, we hope to have fz_text_blocks split
such that each block is a paragraph.
This new implementation has the same restrictions as the current
implementation it replaces, namely that chars are only considered for
addition onto the most recent span at the moment, but this revised form
is designed to allow more easy extension, and for this restriction to
be lifted.
Also add simple paragraph splitting based on finding the most common
'line distance' in blocks.
When we add spans together to collate them into lines, we record the
'horizontal' and 'vertical' spacing between them. (Not actually
horizontal or vertical, so much as 'in the direction of writing' and
'perpendicular to the direction of writing').
The 'horizontal' value enables us to more correctly output spaces when
converting to (say) html later.
The 'vertical' value enables us to spot subscripts and superscripts etc,
as well as small changes in the baseline due to style changes. We are
careful to base the baseline comparison on the baseline for the line,
not the baseline for the previous span, as otherwise superscripts/
subscripts on the end of the line affect what we match next.
Also, we are less tolerant of vertical shifts after a large gap. This
avoids false positives where different columns just happen to almost
line up.
|
|
Some -Wshadow ones, plus some 'set but not used' ones.
|
|
Convert the unicode argv to utf8, and pass in to our existing main
function.
|
|
Thanks to zeniko.
|
|
strncpy is *not* the correct function to use. It does not null terminate,
and it needlessly zeroes past the end. It was designed for fixed length
database records, not strings. Use fz_strlcpy and strlcat instead.
|
|
|
|
|