1839 Commits

Author SHA1 Message Date
Jacek Kucharczyk
ad0b31ea1b
Optimizer fix for the CCITTFax Encoder. ISS #243. Fixes JBIG2 i386 architecture compile issue. (#297)
* Fixed issue #243. Added optimize integration tests.

* Minor style change.

* XObjImage getParamsDict updates Columns and Rows.

* Added doc file for the optimize/tests package.

* UpdateParams for CCITTFax Encoder accepts Width and Height also. Removed 
GetParamsDict Columns and Rows parameters from model.Image and 
model.XObjImage.

* Fix i386 issue for the jbig2 arithmetic encoder.

* Added 386 architecture to the .travis/cross_build.sh
2020-04-08 11:11:49 +00:00
Gunnsteinn Hall
c169f002f8
Merge pull request #298 from adrg/travis-cross-build
Add Travis cross build test
2020-04-07 21:06:03 +00:00
Adrian-George Bostan
fb63969312 Update .travis.yml 2020-04-07 22:56:48 +03:00
Adrian-George Bostan
bfa8aecc18 Add cross build script 2020-04-07 22:56:26 +03:00
Gunnsteinn Hall
ce8472cddd
Merge pull request #296 from unidoc/master
Master into development
2020-04-07 10:07:39 +00:00
Gunnsteinn Hall
0b89bf0c27
Merge pull request #295 from gunnsth/release/v3.6.0
Prepare unipdf release v3.6.0
v3.6.0
2020-04-07 08:57:23 +00:00
Gunnsteinn Hall
dadddb40f1 Update version.go to 3.6.0 2020-04-07 00:07:24 +00:00
Adrian-George Bostan
5a21f16e83
Paragraph components fixes (#294)
* Take spaces into account when wrapping styled paragraph text
* Fix starting position of styled paragraphs
* Wrap text unconditionally when style paragraph height is requested
* Fix styled paragraph text wrapping edge case
* Fix text chunk wrapping edge case
* Adapt text chunk test
* Wrap text unconditionally when paragraph height is requested
* Add text wrapping test case for styled paragraph using character spacing
2020-04-06 23:58:22 +00:00
Jacek Kucharczyk
29efa30439
JBIG2 Encoder support for inserting binary images into PDF (#288)
* Added JBIG2 PDF support
* Added JBIG2 Encoder binary image requirements
* PR #288 revision r1 fixes
* PR #288 revision r2 fixes
2020-04-03 20:54:59 +00:00
Adrian-George Bostan
64a43b38d2
Prevent crashing when processing content stream (#291)
* Skip invalid pop operation on empty graphics state stacks
* Fix clipping input values to size for Type 0 Functions
* Do not pass invalid Q content stream operator to external handlers
2020-04-01 20:08:41 +00:00
Jacek Kucharczyk
c582323a8f
JBIG2 Generic Encoder (#264)
* Prepared skeleton and basic component implementations for the jbig2 encoding.

* Added Bitset. Implemented Bitmap.

* Decoder with old Arithmetic Decoder

* Partly working arithmetic

* Working arithmetic decoder.

* MMR patched.

* rebuild to apache.

* Working generic

* Working generic

* Decoded full document

* Update Jenkinsfile go version [master] (#398)

* Update Jenkinsfile go version

* Decoded AnnexH document

* Minor issues fixed.

* Update README.md

* Fixed generic region errors. Added benchmark. Added bitmap unpadder. Added Bitmap toImage method.

* Fixed endofpage error

* Added integration test.

* Decoded all test files without errors. Implemented JBIG2Global.

* Merged with v3 version

* Fixed the EOF in the globals issue

* Fixed the JBIG2 ChocolateData Decode

* JBIG2 Added license information

* Minor fix in jbig2 encoding.

* Applied the logging convention

* Cleaned unnecessary imports

* Go modules clear unused imports

* checked out the README.md

* Moved trace to Debug. Fixed the build integrate tag in the document_decode_test.go

* Initial encoder skeleton

* Applied UniPDF Developer Guide. Fixed lint issues.

* Cleared documentation, fixed style issues.

* Added jbig2 doc.go files. Applied unipdf guide style.

* Minor code style changes.

* Minor naming and style issues fixes.

* Minor naming changes. Style issues fixed.

* Review r11 fixes.

* Added JBIG2 Encoder skeleton.

* Moved Document and Page to jbig2/document package. Created decoder package responsible for decoding jbig2 stream.

* Implemented raster functions.

* Added raster uni low test funcitons.

* Added raster low test functions

* untracked files on jbig2-encoder: c869089 Added raster low test functions

* index on jbig2-encoder: c869089 Added raster low test functions

* Added morph files.

* implemented jbig2 encoder basics

* JBIG2 Encoder - Generic method

* Added jbig2 image encode ttests, black/white image tests

* cleaned and tested jbig2 package

* unfinished jbig2 classified encoder

* jbig2 minor style changes

* minor jbig2 encoder changes

* prepared JBIG2 Encoder

* Style and lint fixes

* Minor changes and lints

* Fixed shift unsinged value build errors

* Minor naming change

* Added jbig2 encode, image gondels. Fixed jbig2 decode bug.

* Provided jbig2 core.DecodeGlobals function.

* Fixed JBIG2Encoder `r6` revision issues.

* Removed public JBIG2Encoder document.

* Minor style changes

* added NewJBIG2Encoder function.

* fixed JBIG2Encoder 'r9' revision issues.

* Cleared 'r9' commented code.

* Updated ACKNOWLEDGEMENETS. Fixed JBIG2Encoder 'r10' revision issues.

Co-authored-by: Gunnsteinn Hall <gunnsteinn.hall@gmail.com>
2020-03-27 11:47:41 +00:00
Gunnsteinn Hall
2e2a3dd3ce
Merge pull request #286 from adrg/image-handler-nrgba
Use NRGBA when loading model.Image instances from Go images
2020-03-27 00:02:46 +00:00
Adrian-George Bostan
edba514087 Use NRGBA when loading model.Image instances from Go images 2020-03-26 21:47:00 +02:00
Gunnsteinn Hall
38b564cd71
Merge pull request #281 from peterwilliams97/multi.encode.clean
Write out multi-encoder filters correctly
2020-03-19 10:04:24 +00:00
Peter Williams
7a042275de Write out multi-encoder filters correctly 2020-03-19 19:12:05 +11:00
Gunnsteinn Hall
5987255f11
Merge pull request #278 from unidoc/master
Update workflow in development
2020-03-10 10:36:23 +00:00
Gunnsteinn Hall
ed30fe63f3
Stop greeting on PRs as does not work with Actions
See
https://github.com/actions/first-interaction/issues/10
2020-03-09 23:52:07 +00:00
Gunnsteinn Hall
0f9a37df23
Merge pull request #276 from unidoc/master
Master into development branch
2020-03-09 21:19:07 +00:00
Gunnsteinn Hall
d1c808d136
Merge pull request #274 from gunnsth/release/v3.5.0
Prepare unipdf release v3.5.0
v3.5.0
2020-03-09 08:55:32 +00:00
Gunnsteinn Hall
4bdda0af2b
Merge branch 'master' into release/v3.5.0 2020-03-08 23:59:33 +00:00
Gunnsteinn Hall
0a0e53d8c7 Update version to 3.5.0 2020-03-08 23:54:58 +00:00
Gunnsteinn Hall
c22b7efbe1 Prepare release of v3.4.2 2020-03-08 23:51:01 +00:00
Adrian-George Bostan
1d46fb4cc6
Parse ttf encoding subtable 31 after subtable 10 (#273) 2020-03-07 13:08:30 +00:00
Gunnsteinn Hall
937669cfed
Add basic glyph metrics support for Type 0 CID fonts (#272)
* Add basic glyph metrics support for Type 0 CID fonts
* Initialize font widths map if no W array is present
2020-03-05 18:47:16 +00:00
Adrian-George Bostan
d961079c5d
Add basic image rendering support (#266)
* Add render package
* Add text state
* Add more text operators
* Remove unnecessary files
* Add text font
* Add custom text render method
* Improve text rendering method
* Rename text state methods
* Refactor and document context interface
* Refact text begin/end operators
* Fix graphics state transformations
* Keep original font when doing font substitution
* Take page cropbox into account
* Revert to substitution font if original font measurement is 0
* Add font substitution package
* Implement addition transform.Point methods
* Use transform.Point in the image context package
* Remove unneeded functionality from the render image package
* Fix golint notices in the image rendering package
* Fix go vet notices in the render package
* Fix golint notices in the top-level render package
* Improve render context package documentation
* Document context text state struct.
* Document context text font struct.
* Minor logging improvements
* Add license disclaimer to the render package files
* Avoid using package aliases where possible
* Change style of section comments
* Adapt render package import style to follow the developer guide
* Improve documentation for the internal matrix implementation
* Update render package dependency versions
* Apply crop box post render
* Account for offseted media boxes
* Improve metrics of rendered characters
* Fix text matrix translation
* Change priority of fonts used for measuring rendered characters
* Skip invalid m and l operators on image rendering
* Small fix for v operator
* Fix rendered characters spacing issues
* Refactor naming of internal render packages
2020-03-02 21:22:54 +00:00
Peter Williams
e056c0e4d4
Fixed PdfColorspaceSpecialIndexed.ImageToRGB() (#259)
* Fixed PdfColorspaceSpecialIndexed.ImageToRGB() Fixes https://github.com/unidoc/unipdf/issues/258
* Fixed indexed colorspace bounds checking.
* Being super cautious to prevent a divide by zero error. I don't think the base cs can have <1 cpts.
* Updated image hash in extract_images_test.go to match new indexed colorspace code.
* add testfile from unipdf#258
2020-02-26 13:26:20 +00:00
Adrian-George Bostan
9de5fe644e
Add PdfFont text encoding methods (#257)
* Add PdfFont method for encoding runes to charcode bytes
* Add getter method for CMap nbits
* Take CMap nbits into account when encoding text
* Adapt font test cases to include text encoding testing
2020-02-17 22:54:20 +00:00
Gunnsteinn Hall
ea9988fb4d
Merge pull request #256 from unidoc/development
Apply fixes to master
v3.4.1
2020-02-12 00:48:15 +00:00
Gunnsteinn Hall
84f80af92a
Merge pull request #255 from unidoc/master
master into development
2020-02-12 00:39:52 +00:00
Gunnsteinn Hall
fd4f4b0a02
Make sure to stop seeking when reach beginning of file (#254)
* Fix infinite loop bug when looking for EOF
* Add testcases for EOF parsing
2020-02-11 20:09:34 +00:00
Alfred Hall
97286a4e7b
Merge pull request #253 from gunnsth/add-greeting-workflow
Greeting workflow
2020-02-10 23:06:58 +00:00
Gunnsteinn Hall
b33a11b1f2 Greeting workflow 2020-02-10 22:47:23 +00:00
Gunnsteinn Hall
fdee057a6e
Merge pull request #252 from adrg/inline-image-stream-end
Add whitespace tolerance when searching for inline image EI operand
2020-02-10 20:36:01 +00:00
Adrian-George Bostan
e9d2f1de3c Add whitespace tolerance when searching for inline image EI operand 2020-02-10 20:08:47 +02:00
Gunnsteinn Hall
a47c2eafa4
Merge pull request #250 from gunnsth/release/v3.4.0
Merge release v3.4.0 into development
2020-02-10 17:51:32 +00:00
Gunnsteinn Hall
11e21cdcff
Merge pull request #249 from gunnsth/release/v3.4.0
Prepare unipdf release v3.4.0
v3.4.0
2020-02-10 14:56:35 +00:00
Gunnsteinn Hall
42c9cd2e02 Update version to 3.4.0 prepare for release 2020-02-10 08:54:32 +00:00
Adrian-George Bostan
e2b3c6e6ba
Add predefined CMaps for Type 0 composite fonts (#246)
* Add packed predefined cmaps
* Add cmap cid range parsing
* Load base cmap for predefined cmaps
* Refactor pdfFont to Unicode methods
* Preserve CharcodeBytesToUnicode behavior
* Add support for CID-keyed Type 0 fonts
* Add method documentation for the cmap package
* Refactor and document charcode to Unicode conversion code
* Add more cmap parsing test cases
* Add more method documentation in the cmap package.
* Remove unused code from the bcmaps package
* Improve cmap test case
* Assume identity when encoder is missing on regenerating field appearance
* Add missing encoder log message
* Add inverse CMap mappings
* Add CMap encoder
* Address golint notices and small fix in the cmap package
* Keep smaller charcodes when generating cmap inverse mappings
* Update extractor test case
* Keep latest supplement charcodes/CIDs when computing inverse mappings
* Fix comment typo
2020-02-07 19:56:30 +00:00
Gunnsteinn Hall
6a2e4b7a1d
Merge pull request #247 from gunnsth/dev-inlineimage-ignore-optional
Ignore optional inline image field parameters
2020-02-04 23:20:22 +00:00
Gunnsteinn Hall
d97cc71266 Ignore optional inline image field parameters 2020-02-04 22:44:09 +00:00
Gunnsteinn Hall
81e3e14eb9
Merge pull request #242 from unidoc/master
Master into development
2020-01-30 22:24:56 +00:00
Gunnsteinn Hall
b5c7669868
Merge pull request #238 from adrg/eof-marker-search
Add tolerance for seeking EOF marker between read data buffers
2020-01-22 19:59:45 +00:00
Adrian-George Bostan
d521de9643 Add tolerance for seeking EOF marker between read data buffers 2020-01-22 20:56:03 +02:00
Gunnsteinn Hall
843a48ed7b
Merge pull request #233 from adrg/improve-outline-dest-parsing
Improve outline destination parsing
2020-01-21 20:44:07 +00:00
Adrian-George Bostan
3bd083475d Minor refactoring 2020-01-21 22:18:11 +02:00
Adrian-George Bostan
692ead8496 Improve outline destination parsing 2020-01-21 22:11:20 +02:00
Gunnsteinn Hall
38e5979b4c
Merge pull request #232 from adrg/eof-search-buffer
Extend buffer used for searching EOF marker
2020-01-20 17:34:21 +00:00
Adrian-George Bostan
fea1a6a421 Extend buffer used for searching EOF marker 2020-01-20 17:27:52 +02:00
Gunnsteinn Hall
be2b7f40e9
Merge pull request #231 from sprucehealth/fix-get-media-box
Follow object indirections in PdfPage.GetMediaBox
2020-01-18 17:36:08 +00:00
Samuel Stauffer
d3a160ba41 Follow object indirections in PdfPage.GetMediaBox 2020-01-17 14:35:46 -08:00