diff --git a/.gitignore b/.gitignore index 9cd4fb9be..f796ffa45 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,20 @@ CMakeCache.txt CMakeFiles/* -Makefile cmake_install.cmake +CTestTestfile.cmake +gmon.out install_manifest.txt +Makefile pdf2htmlEX pdf2htmlEX.1 +*.pyc +share/base.css +share/base.min.css +share/fancy.css +share/fancy.min.css +share/pdf2htmlEX.js +share/pdf2htmlEX.min.js src/pdf2htmlEX-config.h +src/util/css_const.h +test export-ignore +Testing/* diff --git a/.travis.yml b/.travis.yml index 04fe0f4a4..158967db0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,32 @@ language: cpp compiler: gcc +addons: + sauce_connect: true before_install: + - sudo add-apt-repository ppa:fontforge/fontforge --yes - sudo add-apt-repository ppa:coolwanglu/pdf2htmlex --yes - sudo apt-get update -qq - - sudo apt-get install -qq libpoppler-dev libfontforge-dev libspiro-dev + - sudo apt-get install -qq libpoppler-dev libpoppler-private-dev libspiro-dev libcairo-dev libpango1.0-dev libfreetype6-dev libltdl-dev libfontforge-dev python-imaging python-pip firefox xvfb + - sudo pip install selenium sauceclient + - export DISPLAY=:99.0 + - test/start_xvfb.sh + - pushd / + - python -m SimpleHTTPServer 8000 >/dev/null 2>&1 & + - popd + - sleep 5 before_script: - - cmake . + - cmake -DENABLE_SVG=ON . script: - make + - P2H_TEST_REMOTE=1 ctest --output-on-failure --verbose - sudo make install - /usr/local/bin/pdf2htmlEX -v branches: only: - master + - incoming + - wl +env: + global: + - secure: V0yGXROTAsRc3ExcECj7X/CrJLbodUeqZyfQGkA6x0iLV7Lh8/hgTjSsvuj7ef/DIWMqJ5cAIzZuXiF0KIxiVllF1v0I3w+LScxynT7B1NsyH16hvGIc7EvrsRmGVeTv8n9I+cCIwQxjtliNKfeZjV4Rk2+u6LioUzTszmW2etc= + - secure: Q5ZSrdFEgN0JvUp90nY5Wh58iukmGZQ2EW7crOibWH2yuUsxAnMELxpY+9yV3+eA7kbjJf/I0NCa5ZY1gkxK60ugUj+zuUDTL+BV1XCbO37e0uwh3ae99iyQWpXc8e8wBp10sthoX7U6Hvypa5tD9r1JJib8jxJV/MzIFpb7H9s= diff --git a/3rdparty/PDF.js/LICENSE b/3rdparty/PDF.js/LICENSE new file mode 100644 index 000000000..e454a5258 --- /dev/null +++ b/3rdparty/PDF.js/LICENSE @@ -0,0 +1,178 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/3rdparty/PDF.js/build.sh b/3rdparty/PDF.js/build.sh new file mode 100755 index 000000000..00f5d1e0f --- /dev/null +++ b/3rdparty/PDF.js/build.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# Compile and optimize JS code +# Copyright 2013 Lu Wang + + +BASEDIR=$(dirname $0) +CLOSURE_COMPILER_DIR="$BASEDIR/../closure-compiler" +CLOSURE_COMPILER_JAR="$CLOSURE_COMPILER_DIR/compiler.jar" +INPUT="$BASEDIR/compatibility.js" +OUTPUT_FN="compatibility.min.js" +OUTPUT="$BASEDIR/$OUTPUT_FN" + +(echo "Building $OUTPUT_FN with closure-compiler..." && \ + java -jar "$CLOSURE_COMPILER_JAR" \ + --compilation_level ADVANCED_OPTIMIZATIONS \ + --warning_level VERBOSE \ + --js "$INPUT" \ + --js_output_file "$OUTPUT" && \ + echo 'Done.') || \ +(echo 'Failed. Read `3rdparty/closure-compiler/README` for more detail.' && \ +echo 'Using the uncompressed version.' && \ +cat "$INPUT" > "$OUTPUT") + diff --git a/3rdparty/PDF.js/compatibility.js b/3rdparty/PDF.js/compatibility.js new file mode 100644 index 000000000..31cf179da --- /dev/null +++ b/3rdparty/PDF.js/compatibility.js @@ -0,0 +1,80 @@ +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ +/* Copyright 2012 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** @license Copyright 2012 Mozilla Foundation + * Copyright 2013 Lu Wang + * Apache License Version 2.0 + */ + +'use strict'; + +// HTMLElement classList property +(function checkClassListProperty() { + var div = document.createElement('div'); + if ('classList' in div) + return; // classList property exists + + function changeList(element, itemName, add, remove) { + var s = element.className || ''; + var list = s.split(/\s+/g); + if (list[0] === '') list.shift(); + var index = list.indexOf(itemName); + if (index < 0 && add) + list.push(itemName); + if (index >= 0 && remove) + list.splice(index, 1); + element.className = list.join(' '); + return (index >= 0); + } + + var classListPrototype = { + add: function(name) { + changeList(this.element, name, true, false); + }, + contains: function(name) { + return changeList(this.element, name, false, false); + }, + remove: function(name) { + changeList(this.element, name, false, true); + }, + toggle: function(name) { + changeList(this.element, name, true, true); + } + }; + + Object.defineProperty(HTMLElement.prototype, 'classList', { + get: function() { + if (this['_classList']) + return this['_classList']; + + var classList = Object.create(classListPrototype, { + element: { + value: this, + writable: false, + enumerable: true + } + }); + Object.defineProperty(this, '_classList', { + value: classList, + writable: false, + enumerable: false + }); + return classList; + }, + enumerable: true + }); +})(); diff --git a/3rdparty/PDF.js/compatibility.min.js b/3rdparty/PDF.js/compatibility.min.js new file mode 100644 index 000000000..e5100988c --- /dev/null +++ b/3rdparty/PDF.js/compatibility.min.js @@ -0,0 +1,7 @@ +/* + Copyright 2012 Mozilla Foundation + Copyright 2013 Lu Wang + Apachine License Version 2.0 +*/ +(function(){function b(a,b,e,f){var c=(a.className||"").split(/\s+/g);""===c[0]&&c.shift();var d=c.indexOf(b);0>d&&e&&c.push(b);0<=d&&f&&c.splice(d,1);a.className=c.join(" ");return 0<=d}if(!("classList"in document.createElement("div"))){var e={add:function(a){b(this.element,a,!0,!1)},contains:function(a){return b(this.element,a,!1,!1)},remove:function(a){b(this.element,a,!1,!0)},toggle:function(a){b(this.element,a,!0,!0)}};Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){if(this._classList)return this._classList; +var a=Object.create(e,{element:{value:this,writable:!1,enumerable:!0}});Object.defineProperty(this,"_classList",{value:a,writable:!1,enumerable:!1});return a},enumerable:!0})}})(); diff --git a/3rdparty/closure-compiler/COPYING b/3rdparty/closure-compiler/COPYING new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/3rdparty/closure-compiler/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/3rdparty/closure-compiler/README b/3rdparty/closure-compiler/README new file mode 100644 index 000000000..9a1b609dc --- /dev/null +++ b/3rdparty/closure-compiler/README @@ -0,0 +1,292 @@ +/* + * Copyright 2009 The Closure Compiler Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// +// Contents +// + +The Closure Compiler performs checking, instrumentation, and +optimizations on JavaScript code. The purpose of this README is to +explain how to build and run the Closure Compiler. + +The Closure Compiler requires Java 6 or higher. +http://www.java.com/ + + +// +// Building The Closure Compiler +// + +There are three ways to get a Closure Compiler executable. + +1) Use one we built for you. + +Pre-built Closure binaries can be found at +http://code.google.com/p/closure-compiler/downloads/list + + +2) Check out the source and build it with Apache Ant. + +First, check out the full source tree of the Closure Compiler. There +are instructions on how to do this at the project site. +http://code.google.com/p/closure-compiler/source/checkout + +Apache Ant is a cross-platform build tool. +http://ant.apache.org/ + +At the root of the source tree, there is an Ant file named +build.xml. To use it, navigate to the same directory and type the +command + +ant jar + +This will produce a jar file called "build/compiler.jar". + + +3) Check out the source and build it with Eclipse. + +Eclipse is a cross-platform IDE. +http://www.eclipse.org/ + +Under Eclipse's File menu, click "New > Project ..." and create a +"Java Project." You will see an options screen. Give the project a +name, select "Create project from existing source," and choose the +root of the checked-out source tree as the existing directory. Verify +that you are using JRE version 6 or higher. + +Eclipse can use the build.xml file to discover rules. When you +navigate to the build.xml file, you will see all the build rules in +the "Outline" pane. Run the "jar" rule to build the compiler in +build/compiler.jar. + + +// +// Running The Closure Compiler +// + +Once you have the jar binary, running the Closure Compiler is straightforward. + +On the command line, type + +java -jar compiler.jar + +This starts the compiler in interactive mode. Type + +var x = 17 + 25; + +then hit "Enter", then hit "Ctrl-Z" (on Windows) or "Ctrl-D" (on Mac or Linux) +and "Enter" again. The Compiler will respond: + +var x=42; + +The Closure Compiler has many options for reading input from a file, +writing output to a file, checking your code, and running +optimizations. To learn more, type + +java -jar compiler.jar --help + +You can read more detailed documentation about the many flags at +http://code.google.com/closure/compiler/docs/gettingstarted_app.html + + +// +// Compiling Multiple Scripts +// + +If you have multiple scripts, you should compile them all together with +one compile command. + +java -jar compiler.jar --js=in1.js --js=in2.js ... --js_output_file=out.js + +The Closure Compiler will concatenate the files in the order they're +passed at the command line. + +If you need to compile many, many scripts together, you may start to +run into problems with managing dependencies between scripts. You +should check out the Closure Library. It contains functions for +enforcing dependencies between scripts, and a tool called calcdeps.py +that knows how to give scripts to the Closure Compiler in the right +order. + +http://code.google.com/p/closure-library/ + +// +// Licensing +// + +Unless otherwise stated, all source files are licensed under +the Apache License, Version 2.0. + + +----- +Code under: +src/com/google/javascript/rhino +test/com/google/javascript/rhino + +URL: http://www.mozilla.org/rhino +Version: 1.5R3, with heavy modifications +License: Netscape Public License and MPL / GPL dual license + +Description: A partial copy of Mozilla Rhino. Mozilla Rhino is an +implementation of JavaScript for the JVM. The JavaScript parser and +the parse tree data structures were extracted and modified +significantly for use by Google's JavaScript compiler. + +Local Modifications: The packages have been renamespaced. All code not +relevant to parsing has been removed. A JsDoc parser and static typing +system have been added. + + +----- +Code in: +lib/rhino + +Rhino +URL: http://www.mozilla.org/rhino +Version: Trunk +License: Netscape Public License and MPL / GPL dual license + +Description: Mozilla Rhino is an implementation of JavaScript for the JVM. + +Local Modifications: Minor changes to parsing JSDoc that usually get pushed +up-stream to Rhino trunk. + + +----- +Code in: +lib/args4j.jar + +Args4j +URL: https://args4j.dev.java.net/ +Version: 2.0.16 +License: MIT + +Description: +args4j is a small Java class library that makes it easy to parse command line +options/arguments in your CUI application. + +Local Modifications: None. + + +----- +Code in: +lib/guava.jar + +Guava Libraries +URL: http://code.google.com/p/guava-libraries/ +Version: 15.0 +License: Apache License 2.0 + +Description: Google's core Java libraries. + +Local Modifications: None. + + +----- +Code in: +lib/jsr305.jar + +Annotations for software defect detection +URL: http://code.google.com/p/jsr-305/ +Version: svn revision 47 +License: BSD License + +Description: Annotations for software defect detection. + +Local Modifications: None. + + +----- +Code in: +lib/jarjar.jar + +Jar Jar Links +URL: http://jarjar.googlecode.com/ +Version: 1.1 +License: Apache License 2.0 + +Description: +A utility for repackaging Java libraries. + +Local Modifications: None. + + +---- +Code in: +lib/junit.jar + +JUnit +URL: http://sourceforge.net/projects/junit/ +Version: 4.10 +License: Common Public License 1.0 + +Description: A framework for writing and running automated tests in Java. + +Local Modifications: None. + + +--- +Code in: +lib/protobuf-java.jar + +Protocol Buffers +URL: http://code.google.com/p/protobuf/ +Version: 2.4.1 +License: New BSD License + +Description: Supporting libraries for protocol buffers, +an encoding of structured data. + +Local Modifications: None + + +--- +Code in: +lib/ant.jar +lib/ant-launcher.jar + +URL: http://ant.apache.org/bindownload.cgi +Version: 1.8.1 +License: Apache License 2.0 +Description: + Ant is a Java based build tool. In theory it is kind of like "make" + without make's wrinkles and with the full portability of pure java code. + +Local Modifications: None + + +--- +Code in: +lib/json.jar +URL: http://json.org/java/index.html +Version: JSON version 20090211 +License: MIT license +Description: +JSON is a set of java files for use in transmitting data in JSON format. + +Local Modifications: None + +--- +Code in: +tools/maven-ant-tasks-2.1.3.jar +URL: http://maven.apache.org +Version 2.1.3 +License: Apache License 2.0 +Description: + Maven Ant tasks are used to manage dependencies and to install/deploy to + maven repositories. + +Local Modifications: None diff --git a/3rdparty/closure-compiler/compiler.jar b/3rdparty/closure-compiler/compiler.jar new file mode 100644 index 000000000..d377af774 Binary files /dev/null and b/3rdparty/closure-compiler/compiler.jar differ diff --git a/3rdparty/poppler/COPYING3 b/3rdparty/poppler/COPYING3 new file mode 100644 index 000000000..94a9ed024 --- /dev/null +++ b/3rdparty/poppler/COPYING3 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/src/BackgroundRenderer/CairoOutputDev/CairoFontEngine.cc b/3rdparty/poppler/git/CairoFontEngine.cc similarity index 95% rename from src/BackgroundRenderer/CairoOutputDev/CairoFontEngine.cc rename to 3rdparty/poppler/git/CairoFontEngine.cc index c4493e87a..4571b7fba 100644 --- a/src/BackgroundRenderer/CairoOutputDev/CairoFontEngine.cc +++ b/3rdparty/poppler/git/CairoFontEngine.cc @@ -17,7 +17,7 @@ // Copyright (C) 2005-2007 Jeff Muizelaar // Copyright (C) 2005, 2006 Kristian Høgsberg // Copyright (C) 2005 Martin Kretzschmar -// Copyright (C) 2005, 2009, 2012 Albert Astals Cid +// Copyright (C) 2005, 2009, 2012, 2013 Albert Astals Cid // Copyright (C) 2006, 2007, 2010, 2011 Carlos Garcia Campos // Copyright (C) 2007 Koji Otani // Copyright (C) 2008, 2009 Chris Wilson @@ -26,15 +26,15 @@ // Copyright (C) 2010 Suzuki Toshiya // Copyright (C) 2010 Jan Kümmel // Copyright (C) 2012 Hib Eris +// Copyright (C) 2013 Thomas Freitag // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git // //======================================================================== -#include +#include -#include "config.h" #include #include "CairoFontEngine.h" #include "CairoOutputDev.h" @@ -58,6 +58,16 @@ #pragma implementation #endif +/* + * pdf2htmlEX: disabled multi thread +#if MULTITHREADED +# define fontEngineLocker() MutexLocker locker(&mutex) +#else +*/ +# define fontEngineLocker() +/* +#endif +*/ //------------------------------------------------------------------------ // CairoFont @@ -411,7 +421,8 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, ref = *gfxFont->getID(); fontType = gfxFont->getType(); - if (!(fontLoc = gfxFont->locateFont(xref, gFalse))) { + // pdf2htmlEX: changed gFlase to nullptr + if (!(fontLoc = gfxFont->locateFont(xref, nullptr))) { error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); @@ -558,6 +569,7 @@ typedef struct _type3_font_info { PDFDoc *doc; CairoFontEngine *fontEngine; GBool printing; + XRef *xref; } type3_font_info_t; static void @@ -645,7 +657,7 @@ _render_type3_glyph (cairo_scaled_font_t *scaled_font, box.y2 = mat[3]; gfx = new Gfx(info->doc, output_dev, resDict, &box, NULL); output_dev->startDoc(info->doc, info->fontEngine); - output_dev->startPage (1, gfx->getState()); + output_dev->startPage (1, gfx->getState(), gfx->getXRef()); output_dev->setInType3Char(gTrue); gfx->display(charProcs->getVal(glyph, &charProc)); @@ -674,7 +686,7 @@ _render_type3_glyph (cairo_scaled_font_t *scaled_font, CairoType3Font *CairoType3Font::create(GfxFont *gfxFont, PDFDoc *doc, CairoFontEngine *fontEngine, - GBool printing) { + GBool printing, XRef *xref) { Object refObj, strObj; type3_font_info_t *info; cairo_font_face_t *font_face; @@ -697,6 +709,7 @@ CairoType3Font *CairoType3Font::create(GfxFont *gfxFont, PDFDoc *doc, info->doc = doc; info->fontEngine = fontEngine; info->printing = printing; + info->xref = xref; cairo_font_face_set_user_data (font_face, &type3_font_key, (void *) info, _free_type3_font_info); @@ -714,7 +727,7 @@ CairoType3Font *CairoType3Font::create(GfxFont *gfxFont, PDFDoc *doc, } } - return new CairoType3Font(ref, doc, font_face, codeToGID, codeToGIDLen, printing); + return new CairoType3Font(ref, doc, font_face, codeToGID, codeToGIDLen, printing, xref); } CairoType3Font::CairoType3Font(Ref ref, @@ -722,7 +735,7 @@ CairoType3Font::CairoType3Font(Ref ref, cairo_font_face_t *cairo_font_face, int *codeToGID, Guint codeToGIDLen, - GBool printing) : CairoFont(ref, + GBool printing, XRef *xref) : CairoFont(ref, cairo_font_face, codeToGID, codeToGIDLen, @@ -755,6 +768,12 @@ CairoFontEngine::CairoFontEngine(FT_Library libA) { FT_Library_Version(lib, &major, &minor, &patch); useCIDs = major > 2 || (major == 2 && (minor > 1 || (minor == 1 && patch > 7))); +/* + * pdf2htmlEX: disabled multi thread +#if MULTITHREADED + gInitMutex(&mutex); +#endif +*/ } CairoFontEngine::~CairoFontEngine() { @@ -764,15 +783,22 @@ CairoFontEngine::~CairoFontEngine() { if (fontCache[i]) delete fontCache[i]; } +/* + * pdf2htmlEX: disabled multi thread +#if MULTITHREADED + gDestroyMutex(&mutex); +#endif +*/ } CairoFont * -CairoFontEngine::getFont(GfxFont *gfxFont, PDFDoc *doc, GBool printing) { +CairoFontEngine::getFont(GfxFont *gfxFont, PDFDoc *doc, GBool printing, XRef *xref) { int i, j; Ref ref; CairoFont *font; GfxFontType fontType; + fontEngineLocker(); ref = *gfxFont->getID(); for (i = 0; i < cairoFontCacheSize; ++i) { @@ -788,9 +814,9 @@ CairoFontEngine::getFont(GfxFont *gfxFont, PDFDoc *doc, GBool printing) { fontType = gfxFont->getType(); if (fontType == fontType3) - font = CairoType3Font::create (gfxFont, doc, this, printing); + font = CairoType3Font::create (gfxFont, doc, this, printing, xref); else - font = CairoFreeTypeFont::create (gfxFont, doc->getXRef(), lib, useCIDs); + font = CairoFreeTypeFont::create (gfxFont, xref, lib, useCIDs); //XXX: if font is null should we still insert it into the cache? if (fontCache[cairoFontCacheSize - 1]) { diff --git a/src/BackgroundRenderer/CairoOutputDev/CairoFontEngine.h b/3rdparty/poppler/git/CairoFontEngine.h similarity index 92% rename from src/BackgroundRenderer/CairoOutputDev/CairoFontEngine.h rename to 3rdparty/poppler/git/CairoFontEngine.h index 63353489f..96cc4c15f 100644 --- a/src/BackgroundRenderer/CairoOutputDev/CairoFontEngine.h +++ b/3rdparty/poppler/git/CairoFontEngine.h @@ -19,6 +19,7 @@ // Copyright (C) 2006, 2007 Jeff Muizelaar // Copyright (C) 2006, 2010 Carlos Garcia Campos // Copyright (C) 2008 Adrian Johnson +// Copyright (C) 2013 Thomas Freitag // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -32,6 +33,7 @@ #pragma interface #endif +#include "poppler-config.h" #include "goo/gtypes.h" #include @@ -85,7 +87,7 @@ class CairoType3Font : public CairoFont { public: static CairoType3Font *create(GfxFont *gfxFont, PDFDoc *doc, CairoFontEngine *fontEngine, - GBool printing); + GBool printing, XRef *xref); virtual ~CairoType3Font(); virtual GBool matches(Ref &other, GBool printing); @@ -94,7 +96,7 @@ class CairoType3Font : public CairoFont { CairoType3Font(Ref ref, PDFDoc *doc, cairo_font_face_t *cairo_font_face, int *codeToGID, Guint codeToGIDLen, - GBool printing); + GBool printing, XRef *xref); PDFDoc *doc; }; @@ -113,12 +115,18 @@ class CairoFontEngine { CairoFontEngine(FT_Library libA); ~CairoFontEngine(); - CairoFont *getFont(GfxFont *gfxFont, PDFDoc *doc, GBool printing); + CairoFont *getFont(GfxFont *gfxFont, PDFDoc *doc, GBool printing, XRef *xref); private: CairoFont *fontCache[cairoFontCacheSize]; FT_Library lib; GBool useCIDs; +/* + * pdf2htmlEX: disabled multi thread +#if MULTITHREADED + GooMutex mutex; +#endif +*/ }; #endif diff --git a/src/BackgroundRenderer/CairoOutputDev/CairoOutputDev.cc b/3rdparty/poppler/git/CairoOutputDev.cc similarity index 88% rename from src/BackgroundRenderer/CairoOutputDev/CairoOutputDev.cc rename to 3rdparty/poppler/git/CairoOutputDev.cc index d8f78d75d..ff52824a2 100644 --- a/src/BackgroundRenderer/CairoOutputDev/CairoOutputDev.cc +++ b/3rdparty/poppler/git/CairoOutputDev.cc @@ -18,22 +18,23 @@ // Copyright (C) 2005, 2006 Kristian Høgsberg // Copyright (C) 2005, 2009, 2012 Albert Astals Cid // Copyright (C) 2005 Nickolay V. Shmyrev -// Copyright (C) 2006-2011 Carlos Garcia Campos +// Copyright (C) 2006-2011, 2013 Carlos Garcia Campos // Copyright (C) 2008 Carl Worth -// Copyright (C) 2008-2012 Adrian Johnson +// Copyright (C) 2008-2013 Adrian Johnson // Copyright (C) 2008 Michael Vrable // Copyright (C) 2008, 2009 Chris Wilson -// Copyright (C) 2008 Hib Eris +// Copyright (C) 2008, 2012 Hib Eris // Copyright (C) 2009, 2010 David Benjamin -// Copyright (C) 2011, 2012 Thomas Freitag +// Copyright (C) 2011-2013 Thomas Freitag // Copyright (C) 2012 Patrick Pfeifer +// Copyright (C) 2012 Jason Crain // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git // //======================================================================== -#include +#include #ifdef USE_GCC_PRAGMAS #pragma implementation @@ -43,9 +44,9 @@ #include #include #include +#include #include "goo/gfile.h" -#include "goo/gtypes_p.h" #include "GlobalParams.h" #include "Error.h" #include "Object.h" @@ -61,7 +62,7 @@ #include "CairoOutputDev.h" #include "CairoFontEngine.h" #include "CairoRescaleBox.h" -#include "UTF.h" +#include "UnicodeMap.h" //------------------------------------------------------------------------ // #define LOG_CAIRO @@ -143,6 +144,7 @@ CairoOutputDev::CairoOutputDev() { prescaleImages = gTrue; printing = gTrue; use_show_text_glyphs = gFalse; + inUncoloredPattern = gFalse; inType3Char = gFalse; t3_glyph_has_bbox = gFalse; @@ -162,6 +164,7 @@ CairoOutputDev::CairoOutputDev() { stroke_adjust = globalParams->getStrokeAdjust(); align_stroke_coords = gFalse; adjusted_stroke_width = gFalse; + xref = NULL; } CairoOutputDev::~CairoOutputDev() { @@ -234,18 +237,24 @@ void CairoOutputDev::startDoc(PDFDoc *docA, fontEngine = new CairoFontEngine(ft_lib); fontEngine_owner = gTrue; } + xref = doc->getXRef(); } -void CairoOutputDev::startPage(int pageNum, GfxState *state) { +void CairoOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) { /* set up some per page defaults */ cairo_pattern_destroy(fill_pattern); cairo_pattern_destroy(stroke_pattern); fill_pattern = cairo_pattern_create_rgb(0., 0., 0.); + fill_color.r = fill_color.g = fill_color.b = 0; stroke_pattern = cairo_pattern_reference(fill_pattern); + stroke_color.r = stroke_color.g = stroke_color.b = 0; if (text) text->startPage(state); + if (xrefA != NULL) { + xref = xrefA; + } } void CairoOutputDev::endPage() { @@ -453,6 +462,9 @@ void CairoOutputDev::updateLineWidth(GfxState *state) { void CairoOutputDev::updateFillColor(GfxState *state) { GfxRGB color = fill_color; + if (inUncoloredPattern) + return; + state->getFillRGB(&fill_color); if (cairo_pattern_get_type (fill_pattern) != CAIRO_PATTERN_TYPE_SOLID || color.r != fill_color.r || @@ -473,6 +485,9 @@ void CairoOutputDev::updateFillColor(GfxState *state) { void CairoOutputDev::updateStrokeColor(GfxState *state) { GfxRGB color = stroke_color; + if (inUncoloredPattern) + return; + state->getStrokeRGB(&stroke_color); if (cairo_pattern_get_type (fill_pattern) != CAIRO_PATTERN_TYPE_SOLID || color.r != stroke_color.r || @@ -493,6 +508,9 @@ void CairoOutputDev::updateStrokeColor(GfxState *state) { void CairoOutputDev::updateFillOpacity(GfxState *state) { double opacity = fill_opacity; + if (inUncoloredPattern) + return; + fill_opacity = state->getFillOpacity(); if (opacity != fill_opacity) { cairo_pattern_destroy(fill_pattern); @@ -508,6 +526,9 @@ void CairoOutputDev::updateFillOpacity(GfxState *state) { void CairoOutputDev::updateStrokeOpacity(GfxState *state) { double opacity = stroke_opacity; + if (inUncoloredPattern) + return; + stroke_opacity = state->getStrokeOpacity(); if (opacity != stroke_opacity) { cairo_pattern_destroy(stroke_pattern); @@ -521,6 +542,9 @@ void CairoOutputDev::updateStrokeOpacity(GfxState *state) { } void CairoOutputDev::updateFillColorStop(GfxState *state, double offset) { + if (inUncoloredPattern) + return; + state->getFillRGB(&fill_color); cairo_pattern_add_color_stop_rgba(fill_pattern, offset, @@ -599,7 +623,7 @@ void CairoOutputDev::updateFont(GfxState *state) { if (text) text->updateFont(state); - currentFont = fontEngine->getFont (state->getFont(), doc, printing); + currentFont = fontEngine->getFont (state->getFont(), doc, printing, xref); if (!currentFont) return; @@ -802,7 +826,7 @@ void CairoOutputDev::eoFill(GfxState *state) { } -GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx1, Catalog *cat, Object *str, +GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat, Object *str, double *pmat, int paintType, int /*tilingType*/, Dict *resDict, double *mat, double *bbox, int x0, int y0, int x1, int y1, @@ -843,8 +867,12 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx1, Catalog *cat box.x2 = bbox[2]; box.y2 = bbox[3]; strokePathTmp = strokePathClip; strokePathClip = NULL; - gfx = new Gfx(doc, this, resDict, &box, NULL); + gfx = new Gfx(doc, this, resDict, &box, NULL, NULL, NULL, gfxA->getXRef()); + if (paintType == 2) + inUncoloredPattern = gTrue; gfx->display(str); + if (paintType == 2) + inUncoloredPattern = gFalse; delete gfx; strokePathClip = strokePathTmp; @@ -945,10 +973,21 @@ GBool CairoOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTrian fill_pattern = cairo_pattern_create_mesh (); for (i = 0; i < shading->getNTriangles(); i++) { - shading->getTriangle(i, - &x0, &y0, &color[0], - &x1, &y1, &color[1], - &x2, &y2, &color[2]); + if (shading->isParameterized()) { + double color0, color1, color2; + shading->getTriangle(i, &x0, &y0, &color0, + &x1, &y1, &color1, + &x2, &y2, &color2); + shading->getParameterizedColor(color0, &color[0]); + shading->getParameterizedColor(color1, &color[1]); + shading->getParameterizedColor(color2, &color[2]); + } else { + shading->getTriangle(i, + &x0, &y0, &color[0], + &x1, &y1, &color[1], + &x2, &y2, &color[2]); + + } cairo_mesh_pattern_begin_patch (fill_pattern); @@ -1169,6 +1208,8 @@ void CairoOutputDev::drawChar(GfxState *state, double x, double y, glyphs[glyphCount].y = y - originY; glyphCount++; if (use_show_text_glyphs) { + GooString enc("UTF-8"); + UnicodeMap *utf8Map = globalParams->getUnicodeMap(&enc); if (utf8Max - utf8Count < uLen*6) { // utf8 encoded characters can be up to 6 bytes if (utf8Max > uLen*6) @@ -1179,7 +1220,7 @@ void CairoOutputDev::drawChar(GfxState *state, double x, double y, } clusters[clusterCount].num_bytes = 0; for (int i = 0; i < uLen; i++) { - int size = mapUTF8 (u[i], utf8 + utf8Count, utf8Max - utf8Count); + int size = utf8Map->mapUnicode(u[i], utf8 + utf8Count, utf8Max - utf8Count); utf8Count += size; clusters[clusterCount].num_bytes += size; } @@ -1278,7 +1319,6 @@ void CairoOutputDev::endString(GfxState *state) GBool CairoOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen) { - cairo_save (cairo); double *ctm; cairo_matrix_t matrix; @@ -1536,7 +1576,7 @@ void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha, LOG(printf ("set softMask\n")); - if (alpha == false) { + if (!alpha || transferFunc) { /* We need to mask according to the luminocity of the group. * So we paint the group to an image surface convert it to a luminocity map * and then use that as the mask. */ @@ -1579,13 +1619,15 @@ void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha, cairo_t *maskCtx = cairo_create(source); //XXX: hopefully this uses the correct color space */ - GfxRGB backdropColorRGB; - groupColorSpaceStack->cs->getRGB(backdropColor, &backdropColorRGB); - /* paint the backdrop */ - cairo_set_source_rgb(maskCtx, - colToDbl(backdropColorRGB.r), - colToDbl(backdropColorRGB.g), - colToDbl(backdropColorRGB.b)); + if (!alpha) { + GfxRGB backdropColorRGB; + groupColorSpaceStack->cs->getRGB(backdropColor, &backdropColorRGB); + /* paint the backdrop */ + cairo_set_source_rgb(maskCtx, + colToDbl(backdropColorRGB.r), + colToDbl(backdropColorRGB.g), + colToDbl(backdropColorRGB.b)); + } cairo_paint(maskCtx); /* Copy source ctm to mask ctm and translate origin so that the @@ -1612,15 +1654,14 @@ void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha, int stride = cairo_image_surface_get_stride(source)/4; for (int y=0; ytransform(&lum_in, &lum_out); - lum = (int)(lum_out * 255.0 + 0.5); - } - source_data[y*stride + x] = lum << 24; + int lum = alpha ? fill_opacity : luminocity(source_data[y*stride + x]); + if (transferFunc) { + double lum_in, lum_out; + lum_in = lum/256.0; + transferFunc->transform(&lum_in, &lum_out); + lum = (int)(lum_out * 255.0 + 0.5); + } + source_data[y*stride + x] = lum << 24; } } cairo_surface_mark_dirty (source); @@ -1640,7 +1681,7 @@ void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha, } cairo_surface_destroy(source); - } else { + } else if (alpha) { mask = cairo_pattern_reference(group); cairo_get_matrix(cairo, &mask_matrix); } @@ -1694,27 +1735,26 @@ get_singular_values (const cairo_matrix_t *matrix, *minor = sqrt (f - delta); } -void CairoOutputDev::getScaledSize(int orig_width, - int orig_height, - int *scaledWidth, - int *scaledHeight) { - cairo_matrix_t matrix; - cairo_get_matrix(cairo, &matrix); - +void CairoOutputDev::getScaledSize(const cairo_matrix_t *matrix, + int orig_width, + int orig_height, + int *scaledWidth, + int *scaledHeight) +{ double xScale; double yScale; if (orig_width > orig_height) - get_singular_values (&matrix, &xScale, &yScale); + get_singular_values (matrix, &xScale, &yScale); else - get_singular_values (&matrix, &yScale, &xScale); + get_singular_values (matrix, &yScale, &xScale); int tx, tx2, ty, ty2; /* the integer co-oridinates of the resulting image */ if (xScale >= 0) { - tx = splashRound(matrix.x0 - 0.01); - tx2 = splashRound(matrix.x0 + xScale + 0.01) - 1; + tx = splashRound(matrix->x0 - 0.01); + tx2 = splashRound(matrix->x0 + xScale + 0.01) - 1; } else { - tx = splashRound(matrix.x0 + 0.01) - 1; - tx2 = splashRound(matrix.x0 + xScale - 0.01); + tx = splashRound(matrix->x0 + 0.01) - 1; + tx2 = splashRound(matrix->x0 + xScale - 0.01); } *scaledWidth = abs(tx2 - tx) + 1; //scaledWidth = splashRound(fabs(xScale)); @@ -1725,11 +1765,11 @@ void CairoOutputDev::getScaledSize(int orig_width, *scaledWidth = 1; } if (yScale >= 0) { - ty = splashFloor(matrix.y0 + 0.01); - ty2 = splashCeil(matrix.y0 + yScale - 0.01); + ty = splashFloor(matrix->y0 + 0.01); + ty2 = splashCeil(matrix->y0 + yScale - 0.01); } else { - ty = splashCeil(matrix.y0 - 0.01); - ty2 = splashFloor(matrix.y0 + yScale + 0.01); + ty = splashCeil(matrix->y0 - 0.01); + ty2 = splashFloor(matrix->y0 + yScale + 0.01); } *scaledHeight = abs(ty2 - ty); if (*scaledHeight == 0) { @@ -1737,49 +1777,6 @@ void CairoOutputDev::getScaledSize(int orig_width, } } -cairo_surface_t *CairoOutputDev::downscaleSurface(cairo_surface_t *orig_surface) { - cairo_surface_t *dest_surface; - unsigned char *dest_buffer; - int dest_stride; - unsigned char *orig_buffer; - int orig_width, orig_height; - int orig_stride; - int scaledHeight; - int scaledWidth; - GBool res; - - if (printing) - return NULL; - - orig_width = cairo_image_surface_get_width (orig_surface); - orig_height = cairo_image_surface_get_height (orig_surface); - getScaledSize (orig_width, orig_height, &scaledWidth, &scaledHeight); - if (scaledWidth >= orig_width || scaledHeight >= orig_height) - return NULL; - - dest_surface = cairo_surface_create_similar (orig_surface, - cairo_surface_get_content (orig_surface), - scaledWidth, scaledHeight); - dest_buffer = cairo_image_surface_get_data (dest_surface); - dest_stride = cairo_image_surface_get_stride (dest_surface); - - orig_buffer = cairo_image_surface_get_data (orig_surface); - orig_stride = cairo_image_surface_get_stride (orig_surface); - - res = downscale_box_filter((uint32_t *)orig_buffer, - orig_stride, orig_width, orig_height, - scaledWidth, scaledHeight, 0, 0, - scaledWidth, scaledHeight, - (uint32_t *)dest_buffer, dest_stride); - if (!res) { - cairo_surface_destroy (dest_surface); - return NULL; - } - - return dest_surface; - -} - cairo_filter_t CairoOutputDev::getFilterForSurface(cairo_surface_t *image, GBool interpolate) @@ -1792,8 +1789,14 @@ CairoOutputDev::getFilterForSurface(cairo_surface_t *image, if (orig_width == 0 || orig_height == 0) return CAIRO_FILTER_NEAREST; + /* When printing, don't change the interpolation. */ + if (printing) + return CAIRO_FILTER_NEAREST; + + cairo_matrix_t matrix; + cairo_get_matrix(cairo, &matrix); int scaled_width, scaled_height; - getScaledSize (orig_width, orig_height, &scaled_width, &scaled_height); + getScaledSize (&matrix, orig_width, orig_height, &scaled_width, &scaled_height); /* When scale factor is >= 400% we don't interpolate. See bugs #25268, #9860 */ if (scaled_width / orig_width >= 4 || scaled_height / orig_height >= 4) @@ -2611,9 +2614,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_set_source (cairo, pattern); if (!printing) { - cairo_rectangle (cairo, 0., 0., - MIN (width, maskWidth) / (double)width, - MIN (height, maskHeight) / (double)height); + cairo_rectangle (cairo, 0., 0., 1., 1.); cairo_clip (cairo); } cairo_mask (cairo, maskPattern); @@ -2622,9 +2623,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_pop_group_to_source (cairo); cairo_save (cairo); if (!printing) { - cairo_rectangle (cairo, 0., 0., - MIN (width, maskWidth) / (double)width, - MIN (height, maskHeight) / (double)height); + cairo_rectangle (cairo, 0., 0., 1., 1.); cairo_clip (cairo); } cairo_paint_with_alpha (cairo, fill_opacity); @@ -2635,9 +2634,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s cairo_save (cairo_shape); cairo_set_source (cairo_shape, pattern); if (!printing) { - cairo_rectangle (cairo_shape, 0., 0., - MIN (width, maskWidth) / (double)width, - MIN (height, maskHeight) / (double)height); + cairo_rectangle (cairo_shape, 0., 0., 1., 1.); cairo_fill (cairo_shape); } else { cairo_mask (cairo_shape, pattern); @@ -2725,63 +2722,119 @@ void CairoOutputDev::setMimeData(Stream *str, Object *ref, cairo_surface_t *imag } } -void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, - int width, int height, - GfxImageColorMap *colorMap, - GBool interpolate, - int *maskColors, GBool inlineImg) -{ - cairo_surface_t *image; - cairo_pattern_t *pattern, *maskPattern; +class RescaleDrawImage : public CairoRescaleBox { +private: ImageStream *imgStr; - cairo_matrix_t matrix; - unsigned char *buffer; - int stride, i; - GfxRGB *lookup = NULL; - cairo_filter_t filter = CAIRO_FILTER_BILINEAR; - - /* TODO: Do we want to cache these? */ - imgStr = new ImageStream(str, width, - colorMap->getNumPixelComps(), - colorMap->getBits()); - imgStr->reset(); + GfxRGB *lookup; + int width; + GfxImageColorMap *colorMap; + int *maskColors; + int current_row; + +public: + cairo_surface_t *getSourceImage(Stream *str, + int widthA, int height, + int scaledWidth, int scaledHeight, + GBool printing, + GfxImageColorMap *colorMapA, + int *maskColorsA) { + cairo_surface_t *image = NULL; + int i; + + lookup = NULL; + colorMap = colorMapA; + maskColors = maskColorsA; + width = widthA; + current_row = -1; + + /* TODO: Do we want to cache these? */ + imgStr = new ImageStream(str, width, + colorMap->getNumPixelComps(), + colorMap->getBits()); + imgStr->reset(); #if 0 - /* ICCBased color space doesn't do any color correction - * so check its underlying color space as well */ - int is_identity_transform; - is_identity_transform = colorMap->getColorSpace()->getMode() == csDeviceRGB || - (colorMap->getColorSpace()->getMode() == csICCBased && - ((GfxICCBasedColorSpace*)colorMap->getColorSpace())->getAlt()->getMode() == csDeviceRGB); + /* ICCBased color space doesn't do any color correction + * so check its underlying color space as well */ + int is_identity_transform; + is_identity_transform = colorMap->getColorSpace()->getMode() == csDeviceRGB || + (colorMap->getColorSpace()->getMode() == csICCBased && + ((GfxICCBasedColorSpace*)colorMap->getColorSpace())->getAlt()->getMode() == csDeviceRGB); #endif - image = cairo_image_surface_create (maskColors ? - CAIRO_FORMAT_ARGB32 : - CAIRO_FORMAT_RGB24, - width, height); - if (cairo_surface_status (image)) - goto cleanup; + // special case for one-channel (monochrome/gray/separation) images: + // build a lookup table here + if (colorMap->getNumPixelComps() == 1) { + int n; + Guchar pix; - // special case for one-channel (monochrome/gray/separation) images: - // build a lookup table here - if (colorMap->getNumPixelComps() == 1) { - int n; - Guchar pix; + n = 1 << colorMap->getBits(); + lookup = (GfxRGB *)gmallocn(n, sizeof(GfxRGB)); + for (i = 0; i < n; ++i) { + pix = (Guchar)i; - n = 1 << colorMap->getBits(); - lookup = (GfxRGB *)gmallocn(n, sizeof(GfxRGB)); - for (i = 0; i < n; ++i) { - pix = (Guchar)i; + colorMap->getRGB(&pix, &lookup[i]); + } + } - colorMap->getRGB(&pix, &lookup[i]); + if (printing || scaledWidth >= width || scaledHeight >= height) { + // No downscaling. Create cairo image containing the source image data. + unsigned char *buffer; + int stride; + + image = cairo_image_surface_create (maskColors ? + CAIRO_FORMAT_ARGB32 : + CAIRO_FORMAT_RGB24, + width, height); + if (cairo_surface_status (image)) + goto cleanup; + + buffer = cairo_image_surface_get_data (image); + stride = cairo_image_surface_get_stride (image); + for (int y = 0; y < height; y++) { + uint32_t *dest = (uint32_t *) (buffer + y * stride); + getRow(y, dest); + } + } else { + // // Downscaling required. Create cairo image the size of the + // rescaled image and // downscale the source image data into + // the cairo image. downScaleImage() will call getRow() to read + // source image data from the image stream. This avoids having + // to create an image the size of the source image which may + // exceed cairo's 32676x32767 image size limit (and also saves a + // lot of memory). + image = cairo_image_surface_create (maskColors ? + CAIRO_FORMAT_ARGB32 : + CAIRO_FORMAT_RGB24, + scaledWidth, scaledHeight); + if (cairo_surface_status (image)) + goto cleanup; + + downScaleImage(width, height, + scaledWidth, scaledHeight, + 0, 0, scaledWidth, scaledHeight, + image); } + cairo_surface_mark_dirty (image); + + cleanup: + gfree(lookup); + imgStr->close(); + delete imgStr; + return image; } - buffer = cairo_image_surface_get_data (image); - stride = cairo_image_surface_get_stride (image); - for (int y = 0; y < height; y++) { - uint32_t *dest = (uint32_t *) (buffer + y * stride); - Guchar *pix = imgStr->getLine(); + void getRow(int row_num, uint32_t *row_data) { + int i; + Guchar *pix; + + if (row_num <= current_row) + return; + + while (current_row < row_num) { + pix = imgStr->getLine(); + current_row++; + } if (lookup) { Guchar *p = pix; @@ -2789,54 +2842,64 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, for (i = 0; i < width; i++) { rgb = lookup[*p]; - dest[i] = - ((int) colToByte(rgb.r) << 16) | - ((int) colToByte(rgb.g) << 8) | - ((int) colToByte(rgb.b) << 0); - p++; + row_data[i] = + ((int) colToByte(rgb.r) << 16) | + ((int) colToByte(rgb.g) << 8) | + ((int) colToByte(rgb.b) << 0); + p++; } } else { - colorMap->getRGBLine (pix, dest, width); + colorMap->getRGBLine (pix, row_data, width); } if (maskColors) { for (int x = 0; x < width; x++) { - bool is_opaque = false; - for (int i = 0; i < colorMap->getNumPixelComps(); ++i) { - if (pix[i] < maskColors[2*i] || - pix[i] > maskColors[2*i+1]) { - is_opaque = true; - break; - } - } - if (is_opaque) - *dest |= 0xff000000; - else - *dest = 0; - dest++; - pix += colorMap->getNumPixelComps(); + bool is_opaque = false; + for (int i = 0; i < colorMap->getNumPixelComps(); ++i) { + if (pix[i] < maskColors[2*i] || + pix[i] > maskColors[2*i+1]) { + is_opaque = true; + break; + } + } + if (is_opaque) + *row_data |= 0xff000000; + else + *row_data = 0; + row_data++; + pix += colorMap->getNumPixelComps(); } } } - gfree(lookup); - LOG (printf ("drawImage %dx%d\n", width, height)); +}; - cairo_surface_t *scaled_surface; +void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, + int widthA, int heightA, + GfxImageColorMap *colorMap, + GBool interpolate, + int *maskColors, GBool inlineImg) +{ + cairo_surface_t *image; + cairo_pattern_t *pattern, *maskPattern; + cairo_matrix_t matrix; + int width, height; + int scaledWidth, scaledHeight; + cairo_filter_t filter = CAIRO_FILTER_BILINEAR; + RescaleDrawImage rescale; - scaled_surface = downscaleSurface (image); - if (scaled_surface) { - if (cairo_surface_status (scaled_surface)) - goto cleanup; - cairo_surface_destroy (image); - image = scaled_surface; - width = cairo_image_surface_get_width (image); - height = cairo_image_surface_get_height (image); - } else { - filter = getFilterForSurface (image, interpolate); - } + LOG (printf ("drawImage %dx%d\n", widthA, heightA)); - cairo_surface_mark_dirty (image); + cairo_get_matrix(cairo, &matrix); + getScaledSize (&matrix, widthA, heightA, &scaledWidth, &scaledHeight); + image = rescale.getSourceImage(str, widthA, heightA, scaledWidth, scaledHeight, printing, colorMap, maskColors); + if (!image) + return; + + width = cairo_image_surface_get_width (image); + height = cairo_image_surface_get_height (image); + if (width == widthA && height == heightA) + filter = getFilterForSurface (image, interpolate); if (!inlineImg) /* don't read stream twice if it is an inline image */ setMimeData(str, ref, image); @@ -2844,7 +2907,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, pattern = cairo_pattern_create_for_surface (image); cairo_surface_destroy (image); if (cairo_pattern_status (pattern)) - goto cleanup; + return; cairo_pattern_set_filter (pattern, filter); @@ -2856,7 +2919,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_pattern_set_matrix (pattern, &matrix); if (cairo_pattern_status (pattern)) { cairo_pattern_destroy (pattern); - goto cleanup; + return; } if (!mask && fill_opacity != 1.0) { @@ -2899,10 +2962,6 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, } cairo_pattern_destroy (pattern); - -cleanup: - imgStr->close(); - delete imgStr; } @@ -2935,7 +2994,35 @@ void CairoImageOutputDev::saveImage(CairoImage *image) images = (CairoImage **) greallocn (images, size, sizeof (CairoImage *)); } images[numImages++] = image; -} +} + +void CairoImageOutputDev::getBBox(GfxState *state, int width, int height, + double *x1, double *y1, double *x2, double *y2) +{ + double *ctm = state->getCTM(); + cairo_matrix_t matrix; + cairo_matrix_init(&matrix, + ctm[0], ctm[1], + -ctm[2], -ctm[3], + ctm[2] + ctm[4], ctm[3] + ctm[5]); + + int scaledWidth, scaledHeight; + getScaledSize (&matrix, width, height, &scaledWidth, &scaledHeight); + + if (matrix.xx >= 0) { + *x1 = matrix.x0; + } else { + *x1 = matrix.x0 - scaledWidth; + } + *x2 = *x1 + scaledWidth; + + if (matrix.yy >= 0) { + *y1 = matrix.y0; + } else { + *y1 = matrix.y0 - scaledHeight; + } + *y2 = *y1 + scaledHeight; +} void CairoImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, @@ -2944,22 +3031,9 @@ void CairoImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *st cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; - double *ctm; - double mat[6]; CairoImage *image; - ctm = state->getCTM(); - - mat[0] = ctm[0]; - mat[1] = ctm[1]; - mat[2] = -ctm[2]; - mat[3] = -ctm[3]; - mat[4] = ctm[2] + ctm[4]; - mat[5] = ctm[3] + ctm[5]; - x1 = mat[4]; - y1 = mat[5]; - x2 = x1 + width; - y2 = y1 + height; + getBBox(state, width, height, &x1, &y1, &x2, &y2); image = new CairoImage (x1, y1, x2, y2); saveImage (image); @@ -2980,6 +3054,39 @@ void CairoImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *st } } +void CairoImageOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, Stream *str, + int width, int height, GBool invert, + GBool inlineImg, double *baseMatrix) +{ + cairo_t *cr; + cairo_surface_t *surface; + double x1, y1, x2, y2; + CairoImage *image; + + getBBox(state, width, height, &x1, &y1, &x2, &y2); + + image = new CairoImage (x1, y1, x2, y2); + saveImage (image); + + if (imgDrawCbk && imgDrawCbk (numImages - 1, imgDrawCbkData)) { + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); + cr = cairo_create (surface); + setCairo (cr); + cairo_translate (cr, 0, height); + cairo_scale (cr, width, -height); + + CairoOutputDev::drawImageMask(state, ref, str, width, height, invert, inlineImg, gFalse); + if (state->getFillColorSpace()->getMode() == csPattern) { + cairo_mask (cairo, mask); + } + image->setImage (surface); + + setCairo (NULL); + cairo_surface_destroy (surface); + cairo_destroy (cr); + } +} + void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg) @@ -2987,22 +3094,9 @@ void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; - double *ctm; - double mat[6]; CairoImage *image; - ctm = state->getCTM(); - - mat[0] = ctm[0]; - mat[1] = ctm[1]; - mat[2] = -ctm[2]; - mat[3] = -ctm[3]; - mat[4] = ctm[2] + ctm[4]; - mat[5] = ctm[3] + ctm[5]; - x1 = mat[4]; - y1 = mat[5]; - x2 = x1 + width; - y2 = y1 + height; + getBBox(state, width, height, &x1, &y1, &x2, &y2); image = new CairoImage (x1, y1, x2, y2); saveImage (image); @@ -3035,22 +3129,9 @@ void CairoImageOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stre cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; - double *ctm; - double mat[6]; CairoImage *image; - ctm = state->getCTM(); - - mat[0] = ctm[0]; - mat[1] = ctm[1]; - mat[2] = -ctm[2]; - mat[3] = -ctm[3]; - mat[4] = ctm[2] + ctm[4]; - mat[5] = ctm[3] + ctm[5]; - x1 = mat[4]; - y1 = mat[5]; - x2 = x1 + width; - y2 = y1 + height; + getBBox(state, width, height, &x1, &y1, &x2, &y2); image = new CairoImage (x1, y1, x2, y2); saveImage (image); @@ -3083,22 +3164,9 @@ void CairoImageOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream * cairo_t *cr; cairo_surface_t *surface; double x1, y1, x2, y2; - double *ctm; - double mat[6]; CairoImage *image; - ctm = state->getCTM(); - - mat[0] = ctm[0]; - mat[1] = ctm[1]; - mat[2] = -ctm[2]; - mat[3] = -ctm[3]; - mat[4] = ctm[2] + ctm[4]; - mat[5] = ctm[3] + ctm[5]; - x1 = mat[4]; - y1 = mat[5]; - x2 = x1 + width; - y2 = y1 + height; + getBBox(state, width, height, &x1, &y1, &x2, &y2); image = new CairoImage (x1, y1, x2, y2); saveImage (image); diff --git a/src/BackgroundRenderer/CairoOutputDev/CairoOutputDev.h b/3rdparty/poppler/git/CairoOutputDev.h similarity index 94% rename from src/BackgroundRenderer/CairoOutputDev/CairoOutputDev.h rename to 3rdparty/poppler/git/CairoOutputDev.h index df76975cf..f345e3993 100644 --- a/src/BackgroundRenderer/CairoOutputDev/CairoOutputDev.h +++ b/3rdparty/poppler/git/CairoOutputDev.h @@ -17,10 +17,10 @@ // Copyright (C) 2005-2008 Jeff Muizelaar // Copyright (C) 2005, 2006 Kristian Høgsberg // Copyright (C) 2005 Nickolay V. Shmyrev -// Copyright (C) 2006-2011 Carlos Garcia Campos -// Copyright (C) 2008, 2009, 2011, 2012 Adrian Johnson +// Copyright (C) 2006-2011, 2013 Carlos Garcia Campos +// Copyright (C) 2008, 2009, 2011-2013 Adrian Johnson // Copyright (C) 2008 Michael Vrable -// Copyright (C) 2010-2012 Thomas Freitag +// Copyright (C) 2010-2013 Thomas Freitag // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -124,7 +124,7 @@ class CairoOutputDev: public OutputDev { //----- initialization and control // Start a page. - virtual void startPage(int pageNum, GfxState *state); + virtual void startPage(int pageNum, GfxState *state, XRef *xref); // End a page. virtual void endPage(); @@ -192,7 +192,6 @@ class CairoOutputDev: public OutputDev { CharCode code, Unicode *u, int uLen); virtual void endType3Char(GfxState *state); virtual void beginTextObject(GfxState *state); - virtual GBool deviceHasTextClip(GfxState *state) { return textClipPath; } virtual void endTextObject(GfxState *state); //----- image drawing @@ -267,11 +266,14 @@ class CairoOutputDev: public OutputDev { protected: void doPath(cairo_t *cairo, GfxState *state, GfxPath *path); cairo_surface_t *downscaleSurface(cairo_surface_t *orig_surface); - void getScaledSize(int orig_width, int orig_height, + void getScaledSize(const cairo_matrix_t *matrix, + int orig_width, int orig_height, int *scaledWidth, int *scaledHeight); cairo_filter_t getFilterForSurface(cairo_surface_t *image, GBool interpolate); GBool getStreamData (Stream *str, char **buffer, int *length); + // pdf2htmlEX: make setMimeData virtual, we need to override it + virtual void setMimeData(Stream *str, Object *ref, cairo_surface_t *image); void fillToStrokePathClip(GfxState *state); void alignStrokeCoords(GfxSubpath *subpath, int i, double *x, double *y); @@ -284,6 +286,7 @@ class CairoOutputDev: public OutputDev { GBool adjusted_stroke_width; GBool align_stroke_coords; CairoFont *currentFont; + XRef *xref; struct StrokePathClip { GfxPath *path; @@ -319,6 +322,7 @@ class CairoOutputDev: public OutputDev { int utf8Count; int utf8Max; cairo_path_t *textClipPath; + GBool inUncoloredPattern; // inside a uncolored pattern (PaintType = 2) GBool inType3Char; // inside a Type 3 CharProc double t3_glyph_wx, t3_glyph_wy; GBool t3_glyph_has_bbox; @@ -465,6 +469,11 @@ class CairoImageOutputDev: public CairoOutputDev { Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert, GBool maskInterpolate); + virtual void setSoftMaskFromImageMask(GfxState *state, Object *ref, Stream *str, + int width, int height, GBool invert, + GBool inlineImg, double *baseMatrix); + virtual void unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) {} + //----- transparency groups and soft masks virtual void beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/, @@ -487,6 +496,8 @@ class CairoImageOutputDev: public CairoOutputDev { private: void saveImage(CairoImage *image); + void getBBox(GfxState *state, int width, int height, + double *x1, double *y1, double *x2, double *y2); CairoImage **images; int numImages; diff --git a/src/BackgroundRenderer/CairoOutputDev/CairoRescaleBox.cc b/3rdparty/poppler/git/CairoRescaleBox.cc similarity index 72% rename from src/BackgroundRenderer/CairoOutputDev/CairoRescaleBox.cc rename to 3rdparty/poppler/git/CairoRescaleBox.cc index 68a0c4cb0..3d196892e 100644 --- a/src/BackgroundRenderer/CairoOutputDev/CairoRescaleBox.cc +++ b/3rdparty/poppler/git/CairoRescaleBox.cc @@ -31,6 +31,7 @@ // under GPL version 2 or later // // Copyright (C) 2012 Hib Eris +// Copyright (C) 2012 Adrian Johnson // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -50,13 +51,13 @@ #include #include #include "goo/gmem.h" -#include "goo/gtypes_p.h" #include "CairoRescaleBox.h" /* we work in fixed point where 1. == 1 << 24 */ #define FIXED_SHIFT 24 + static void downsample_row_box_filter ( int start, int width, uint32_t *src, uint32_t *dest, @@ -261,106 +262,116 @@ static int compute_coverage (int coverage[], int src_length, int dest_length) return ratio; } -GBool downscale_box_filter(uint32_t *orig, int orig_stride, unsigned orig_width, unsigned orig_height, - signed scaled_width, signed scaled_height, - uint16_t start_column, uint16_t start_row, - uint16_t width, uint16_t height, - uint32_t *dest, int dst_stride) -{ - int pixel_coverage_x, pixel_coverage_y; - int dest_y; - int src_y = 0; - uint32_t *scanline = orig; - int *x_coverage = NULL; - int *y_coverage = NULL; - uint32_t *temp_buf = NULL; - GBool retval = gFalse; - - x_coverage = (int *)gmallocn3 (orig_width, 1, sizeof(int)); - y_coverage = (int *)gmallocn3 (orig_height, 1, sizeof(int)); - - /* we need to allocate enough room for ceil(src_height/dest_height)+1 - Example: - src_height = 140 - dest_height = 50 - src_height/dest_height = 2.8 - - |-------------| 2.8 pixels - |----|----|----|----| 4 pixels - need to sample 3 pixels - - |-------------| 2.8 pixels - |----|----|----|----| 4 pixels - need to sample 4 pixels - */ - temp_buf = (uint32_t *)gmallocn3 ((orig_height + scaled_height-1)/scaled_height+1, scaled_width, sizeof(uint32_t)); +GBool CairoRescaleBox::downScaleImage(unsigned orig_width, unsigned orig_height, + signed scaled_width, signed scaled_height, + unsigned short int start_column, unsigned short int start_row, + unsigned short int width, unsigned short int height, + cairo_surface_t *dest_surface) { + int pixel_coverage_x, pixel_coverage_y; + int dest_y; + int src_y = 0; + uint32_t *scanline; + int *x_coverage = NULL; + int *y_coverage = NULL; + uint32_t *temp_buf = NULL; + GBool retval = gFalse; + unsigned int *dest; + int dst_stride; + + dest = (unsigned int *)cairo_image_surface_get_data (dest_surface); + dst_stride = cairo_image_surface_get_stride (dest_surface); + + scanline = (uint32_t*)gmallocn3 (orig_width, 1, sizeof(int)); + + x_coverage = (int *)gmallocn3 (orig_width, 1, sizeof(int)); + y_coverage = (int *)gmallocn3 (orig_height, 1, sizeof(int)); + + /* we need to allocate enough room for ceil(src_height/dest_height)+1 + Example: + src_height = 140 + dest_height = 50 + src_height/dest_height = 2.8 - if (!x_coverage || !y_coverage || !scanline || !temp_buf) - goto cleanup; + |-------------| 2.8 pixels + |----|----|----|----| 4 pixels + need to sample 3 pixels - pixel_coverage_x = compute_coverage (x_coverage, orig_width, scaled_width); - pixel_coverage_y = compute_coverage (y_coverage, orig_height, scaled_height); + |-------------| 2.8 pixels + |----|----|----|----| 4 pixels + need to sample 4 pixels + */ - assert (width + start_column <= scaled_width); + temp_buf = (uint32_t *)gmallocn3 ((orig_height + scaled_height-1)/scaled_height+1, scaled_width, sizeof(uint32_t)); - /* skip the rows at the beginning */ - for (dest_y = 0; dest_y < start_row; dest_y++) + if (!x_coverage || !y_coverage || !scanline || !temp_buf) + goto cleanup; + + pixel_coverage_x = compute_coverage (x_coverage, orig_width, scaled_width); + pixel_coverage_y = compute_coverage (y_coverage, orig_height, scaled_height); + + assert (width + start_column <= scaled_width); + + + + /* skip the rows at the beginning */ + for (dest_y = 0; dest_y < start_row; dest_y++) + { + int box = 1 << FIXED_SHIFT; + int start_coverage_y = y_coverage[dest_y]; + box -= start_coverage_y; + src_y++; + while (box >= pixel_coverage_y) { - int box = 1 << FIXED_SHIFT; - int start_coverage_y = y_coverage[dest_y]; - box -= start_coverage_y; - src_y++; - while (box >= pixel_coverage_y) - { - box -= pixel_coverage_y; - src_y++; - } + box -= pixel_coverage_y; + src_y++; } + } - for (; dest_y < start_row + height; dest_y++) - { - int columns = 0; - int box = 1 << FIXED_SHIFT; - int start_coverage_y = y_coverage[dest_y]; + for (; dest_y < start_row + height; dest_y++) + { + int columns = 0; + int box = 1 << FIXED_SHIFT; + int start_coverage_y = y_coverage[dest_y]; - scanline = orig + src_y * orig_stride / 4; - downsample_row_box_filter (start_column, width, scanline, temp_buf + width * columns, x_coverage, pixel_coverage_x); - columns++; - src_y++; - box -= start_coverage_y; + getRow(src_y, scanline); + downsample_row_box_filter (start_column, width, scanline, temp_buf + width * columns, x_coverage, pixel_coverage_x); + columns++; + src_y++; + box -= start_coverage_y; - while (box >= pixel_coverage_y) - { - scanline = orig + src_y * orig_stride / 4; - downsample_row_box_filter (start_column, width, scanline, temp_buf + width * columns, x_coverage, pixel_coverage_x); - columns++; - src_y++; - box -= pixel_coverage_y; - } + while (box >= pixel_coverage_y) + { + getRow(src_y, scanline); + downsample_row_box_filter (start_column, width, scanline, temp_buf + width * columns, x_coverage, pixel_coverage_x); + columns++; + src_y++; + box -= pixel_coverage_y; + } - /* downsample any leftovers */ - if (box > 0) - { - scanline = orig + src_y * orig_stride / 4; - downsample_row_box_filter (start_column, width, scanline, temp_buf + width * columns, x_coverage, pixel_coverage_x); - columns++; - } + /* downsample any leftovers */ + if (box > 0) + { + getRow(src_y, scanline); + downsample_row_box_filter (start_column, width, scanline, temp_buf + width * columns, x_coverage, pixel_coverage_x); + columns++; + } - /* now scale the rows we just downsampled in the y direction */ - downsample_columns_box_filter (width, start_coverage_y, pixel_coverage_y, temp_buf, dest); - dest += dst_stride / 4; + /* now scale the rows we just downsampled in the y direction */ + downsample_columns_box_filter (width, start_coverage_y, pixel_coverage_y, temp_buf, dest); + dest += dst_stride / 4; // assert(width*columns <= ((orig_height + scaled_height-1)/scaled_height+1) * width); - } + } // assert (src_y<=orig_height); - retval = gTrue; + retval = gTrue; cleanup: - free (x_coverage); - free (y_coverage); - free (temp_buf); + free (x_coverage); + free (y_coverage); + free (temp_buf); + free (scanline); - return retval; + return retval; } diff --git a/3rdparty/poppler/git/CairoRescaleBox.h b/3rdparty/poppler/git/CairoRescaleBox.h new file mode 100644 index 000000000..072e8a9c8 --- /dev/null +++ b/3rdparty/poppler/git/CairoRescaleBox.h @@ -0,0 +1,61 @@ +/* + * Copyright © 2009 Mozilla Corporation + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Mozilla Corporation not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Mozilla Corporation makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * MOZILLA CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT + * SHALL MOZILLA CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + * + * Author: Jeff Muizelaar, Mozilla Corp. + */ + +//======================================================================== +// +// Modified under the Poppler project - http://poppler.freedesktop.org +// +// All changes made under the Poppler project to this file are licensed +// under GPL version 2 or later +// +// Copyright (C) 2012 Adrian Johnson +// +// To see a description of the changes please see the Changelog file that +// came with your tarball or type make ChangeLog if you are building from git +// +//======================================================================== + +#ifndef CAIRO_RESCALE_BOX_H +#define CAIRO_RESCALE_BOX_H + +#include "goo/gtypes.h" +#include + +class CairoRescaleBox { +public: + + CairoRescaleBox() {}; + virtual ~CairoRescaleBox() {}; + + virtual GBool downScaleImage(unsigned orig_width, unsigned orig_height, + signed scaled_width, signed scaled_height, + unsigned short int start_column, unsigned short int start_row, + unsigned short int width, unsigned short int height, + cairo_surface_t *dest_surface); + + virtual void getRow(int row_num, uint32_t *row_data) = 0; + +}; + +#endif /* CAIRO_RESCALE_BOX_H */ diff --git a/3rdparty/yuicompressor/LICENSE.TXT b/3rdparty/yuicompressor/LICENSE.TXT new file mode 100644 index 000000000..8a1c7a1af --- /dev/null +++ b/3rdparty/yuicompressor/LICENSE.TXT @@ -0,0 +1,54 @@ +YUI Compressor Copyright License Agreement (BSD License) + +Copyright (c) 2013, Yahoo! Inc. +All rights reserved. + +Redistribution and use of this software in source and binary forms, +with or without modification, are permitted provided that the following +conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of Yahoo! Inc. nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission of Yahoo! Inc. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This software also requires access to software from the following sources: + +The Jarg Library v 1.0 ( http://jargs.sourceforge.net/ ) is available +under a BSD License � Copyright (c) 2001-2003 Steve Purcell, +Copyright (c) 2002 Vidar Holen, Copyright (c) 2002 Michal Ceresna and +Copyright (c) 2005 Ewan Mellor. + +The Rhino Library ( http://www.mozilla.org/rhino/ ) is dually available +under an MPL 1.1/GPL 2.0 license, with portions subject to a BSD license. + +Additionally, this software contains modified versions of the following +component files from the Rhino Library: + +[org/mozilla/javascript/Decompiler.java] +[org/mozilla/javascript/Parser.java] +[org/mozilla/javascript/Token.java] +[org/mozilla/javascript/TokenStream.java] + +The modified versions of these files are distributed under the MPL v 1.1 +( http://www.mozilla.org/MPL/MPL-1.1.html ) diff --git a/3rdparty/yuicompressor/yuicompressor-2.4.8.jar b/3rdparty/yuicompressor/yuicompressor-2.4.8.jar new file mode 100644 index 000000000..a1cf0a092 Binary files /dev/null and b/3rdparty/yuicompressor/yuicompressor-2.4.8.jar differ diff --git a/AUTHORS b/AUTHORS index 0a4053e55..7b8a72c75 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,14 +1,33 @@ +pdf2htmlEX is created and maintained by +Lu Wang + +Contributors: (alphabetical order) +Aamir Adnan +Chris Cinelli +Daniel Bonniot de Ruisselet Deepak +Denis Sablic +Duan Yao filodej hasufell Herbert Jones Hongliang Tian +Johannes Schauer John Hewson -Lu Wang +Marc Sanfacon +Michele Redolfi +Mick Giles +Ryan Morlok +Simon Chenard +Wanmin Liu Packagers: Arthur Titeica Deepak Thukral Jamie Ly Lu Wang +Steven Lee +Special Thanks: +Wanmin Liu +Hongliang Tian diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a6839de3..4cad84764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,9 +5,11 @@ set(CMAKE_BUILD_TYPE Release CACHE STRING "Build configuration (Debug, Release, project(pdf2htmlEX) cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) +option(ENABLE_SVG "Enable SVG support, for generating SVG background images and converting Type 3 fonts" ON) + include_directories(${CMAKE_SOURCE_DIR}/src) -set(PDF2HTMLEX_VERSION "0.7") +set(PDF2HTMLEX_VERSION "0.14.6") set(ARCHIVE_NAME pdf2htmlex-${PDF2HTMLEX_VERSION}) add_custom_target(dist COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD @@ -15,101 +17,52 @@ add_custom_target(dist WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) find_package(PkgConfig) -pkg_check_modules(POPPLER REQUIRED poppler>=0.20.0) + + +pkg_check_modules(POPPLER REQUIRED poppler>=0.25.0) include_directories(${POPPLER_INCLUDE_DIRS}) link_directories(${POPPLER_LIBRARY_DIRS}) set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${POPPLER_LIBRARIES}) -# disable CAIRO for now -if(0) -pkg_check_modules(POPPLER_CAIRO poppler-cairo>=0.20.0) -if(POPPLER_CAIRO_FOUND) - set(HAVE_CAIRO 1) - include_directories(${POPPLER_CAIRO_INCLUDE_DIRS}) - link_directories(${POPPLER_CAIRO_LIBRARY_DIRS}) - set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${POPPLER_CAIRO_LIBRARIES}) -else() - set(HAVE_CAIRO 0) -endif() -else() -set(HAVE_CAIRO 0) -endif() - - -# fontforge starts using pkg-config 'correctly' since 2.0.0 -pkg_check_modules(FONTFORGE libfontforge>=2.0.0) -if(FONTFORGE_FOUND) - include_directories(${FONTFORGE_INCLUDE_DIRS}) - link_directories(${FONTFORGE_LIBRARY_DIRS}) - set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FONTFORGE_LIBRARIES}) -else() - message("Trying to locate fontforge...") - find_path(FF_INCLUDE_PATH fontforge/fontforge.h) - if(FF_INCLUDE_PATH) - message("Found fontforge.h: ${FF_INCLUDE_PATH}/fontforge/fontforge.h") - set(FONTFORGE_INCLUDE_DIRS ${FF_INCLUDE_PATH}/fontforge) - include_directories(${FONTFORGE_INCLUDE_DIRS}) - # MacOSX gettext is in /opt/local/include - strange - if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - find_path(GETTEXT_INCLUDE_PATH libintl.h HINTS "/usr/local/opt/gettext/include") # homebrew - if(GETTEXT_INCLUDE_PATH) - include_directories(${GETTEXT_INCLUDE_PATH}) - else() - message("Cannot found libintl.h, if you see errors about libintl.h, add the path to gettext header files into your include paths") - endif() - endif() - else() - message(FATAL_ERROR "Error: cannot locate fontforge.h") - endif() - - macro(wl_find_library LIB_NAME RESULT) - unset(${RESULT}) - unset(${RESULT} CACHE) - foreach(FULL_LIB_NAME - ${CMAKE_IMPORT_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX} - ${CMAKE_SHARED_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} - ${CMAKE_STATIC_LIBRARY_PREFIX}${LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX} +if(ENABLE_SVG) + pkg_check_modules(CAIRO REQUIRED cairo>=1.10.0) + message("Trying to locate cairo-svg...") + find_path(CAIRO_SVG_INCLUDE_PATH cairo-svg.h PATHS ${CAIRO_INCLUDE_DIRS} NO_DEFAULT_PATH) + if(CAIRO_SVG_INCLUDE_PATH) + include_directories(${CAIRO_INCLUDE_DIRS}) + link_directories(${CAIRO_LIBRARY_DIRS}) + set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${CAIRO_LIBRARIES}) + set(ENABLE_SVG 1) + set(CAIROOUTPUTDEV_PATH 3rdparty/poppler/git) + include_directories(${CAIROOUTPUTDEV_PATH}) + set(PDF2HTMLEX_SRC ${PDF2HTMLEX_SRC} + ${CAIROOUTPUTDEV_PATH}/CairoFontEngine.h + ${CAIROOUTPUTDEV_PATH}/CairoFontEngine.cc + ${CAIROOUTPUTDEV_PATH}/CairoRescaleBox.h + ${CAIROOUTPUTDEV_PATH}/CairoRescaleBox.cc + ${CAIROOUTPUTDEV_PATH}/CairoOutputDev.h + ${CAIROOUTPUTDEV_PATH}/CairoOutputDev.cc ) - find_library(FULL_LIB ${FULL_LIB_NAME}) - if(FULL_LIB) - message("Found ${LIB_NAME}: ${FULL_LIB}") - set(${RESULT} ${FULL_LIB}) - break() - endif() - endforeach() - unset(FULL_LIB_NAME) - unset(FULL_LIB_NAME CACHE) - unset(FULL_LIB) - unset(FULL_LIB CACHE) - endmacro() - - wl_find_library(fontforge FONTFORGE_LIBRARIES) - if(NOT DEFINED FONTFORGE_LIBRARIES) - set(FONTFORGE_LIBRARIES fontforge) - message("Error: cannot locate fontforge") + else() + message(FATAL_ERROR "Error: no SVG support found in Cairo") endif() - set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FONTFORGE_LIBRARIES}) - wl_find_library(gunicode GUNICODE_LIBRARIES) - set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${GUNICODE_LIBRARIES}) - - message("Looking for libraries of python, which is required by fontforge, if you can link fontforge without python, you may disable this") - pkg_search_module(PYTHON python python-2.7) - set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${PYTHON_LIBRARIES}) + find_package(Freetype REQUIRED) + include_directories(${FREETYPE_INCLUDE_DIRS}) + link_directories(${FREETYPE_LIBRARY_DIRS}) + set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FREETYPE_LIBRARIES}) endif() -find_path(FF_CONFIG_INCLUDE_PATH config.h PATHS - ${FONTFORGE_INCLUDE_DIRS} NO_DEFAULT_PATH) -if(FF_CONFIG_INCLUDE_PATH) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${FF_CONFIG_INCLUDE_PATH}/config.h") -message("Found config.h: ${FF_CONFIG_INCLUDE_PATH}/config.h") -else() -message("Cannot locate config.h for fontforge") -endif() +# fontforge starts using pkg-config 'correctly' since 2.0.0 +pkg_check_modules(FONTFORGE REQUIRED libfontforge>=2.0.0) +include_directories(${FONTFORGE_INCLUDE_DIRS}) +link_directories(${FONTFORGE_LIBRARY_DIRS}) +set(PDF2HTMLEX_LIBS ${PDF2HTMLEX_LIBS} ${FONTFORGE_LIBRARIES}) # debug build flags (overwrite default cmake debug flags) -set(CMAKE_C_FLAGS_DEBUG "-ggdb") -set(CMAKE_CXX_FLAGS_DEBUG "-ggdb") +set(CMAKE_C_FLAGS_DEBUG "-ggdb -pg") +set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -pg") +set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-pg") # release build flags (overwrite default cmake release flags) set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") @@ -126,48 +79,62 @@ endif() # CYGWIN or GCC 4.5.x bug if(CYGWIN) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=gnu++0x") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") else() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") endif() -include(CheckCXXCompilerFlag) -check_cxx_compiler_flag("${CMAKE_CXX_FLAGS}" CXX0X_SUPPORT) +# check the C++11 features we need +include(CheckCXXSourceCompiles) +check_cxx_source_compiles(" +#include +int main() +{ + char * ptr = nullptr; + std::vector v; + auto f = [&](){ for(auto & i : v) ++i; }; + f(); +} +" CXX0X_SUPPORT) if(NOT CXX0X_SUPPORT) - message(FATAL_ERROR "Error: you compiler does not support C++0x, please update it.") + message(FATAL_ERROR "Error: your compiler does not support C++0x/C++11, please update it.") endif() configure_file (${CMAKE_SOURCE_DIR}/src/pdf2htmlEX-config.h.in ${CMAKE_SOURCE_DIR}/src/pdf2htmlEX-config.h) configure_file (${CMAKE_SOURCE_DIR}/pdf2htmlEX.1.in ${CMAKE_SOURCE_DIR}/pdf2htmlEX.1) -add_executable(pdf2htmlEX +include(${CMAKE_SOURCE_DIR}/src/css_class_names.cmakelists.txt) +configure_file (${CMAKE_SOURCE_DIR}/src/util/css_const.h.in ${CMAKE_SOURCE_DIR}/src/util/css_const.h) +configure_file (${CMAKE_SOURCE_DIR}/share/base.css.in ${CMAKE_SOURCE_DIR}/share/base.css) +configure_file (${CMAKE_SOURCE_DIR}/share/fancy.css.in ${CMAKE_SOURCE_DIR}/share/fancy.css) +configure_file (${CMAKE_SOURCE_DIR}/share/pdf2htmlEX.js.in ${CMAKE_SOURCE_DIR}/share/pdf2htmlEX.js) + +set(PDF2HTMLEX_SRC ${PDF2HTMLEX_SRC} src/Param.h + src/pdf2htmlEX.cc src/pdf2htmlEX-config.h - src/pdf2htmlEX.cc - src/HTMLRenderer/HTMLRenderer.h + src/HTMLRenderer/HTMLRenderer.h src/HTMLRenderer/draw.cc - src/HTMLRenderer/export.cc src/HTMLRenderer/general.cc src/HTMLRenderer/image.cc - src/HTMLRenderer/install.cc - src/HTMLRenderer/TextLineBuffer.h - src/HTMLRenderer/TextLineBuffer.cc + src/HTMLRenderer/font.cc + src/HTMLRenderer/form.cc src/HTMLRenderer/link.cc src/HTMLRenderer/outline.cc src/HTMLRenderer/state.cc src/HTMLRenderer/text.cc - src/BackgroundRenderer/BackgroundRenderer.h - src/BackgroundRenderer/SplashBackgroundRenderer.h - src/BackgroundRenderer/SplashBackgroundRenderer.cc - src/BackgroundRenderer/CairoBackgroundRenderer.h - src/BackgroundRenderer/CairoBackgroundRenderer.cc - src/util/ArgParser.h - src/util/ArgParser.cc - src/util/base64stream.h - src/util/base64stream.cc + src/BackgroundRenderer/BackgroundRenderer.h + src/BackgroundRenderer/BackgroundRenderer.cc + src/BackgroundRenderer/SplashBackgroundRenderer.h + src/BackgroundRenderer/SplashBackgroundRenderer.cc + src/BackgroundRenderer/CairoBackgroundRenderer.h + src/BackgroundRenderer/CairoBackgroundRenderer.cc src/util/const.h src/util/const.cc + src/util/css_const.h + src/util/encoding.h + src/util/encoding.cc src/util/ffw.h src/util/ffw.c src/util/math.h @@ -177,23 +144,90 @@ add_executable(pdf2htmlEX src/util/namespace.h src/util/path.h src/util/path.cc - src/util/Preprocessor.h - src/util/Preprocessor.cc - src/util/StringFormatter.h - src/util/StringFormatter.cc - src/util/TmpFiles.h - src/util/TmpFiles.cc src/util/unicode.h src/util/unicode.cc + src/util/mingw.h + src/util/mingw.cc + src/ArgParser.h + src/ArgParser.cc + src/Base64Stream.h + src/Base64Stream.cc + src/Color.h + src/Color.cc + src/CoveredTextDetector.h + src/CoveredTextDetector.cc + src/DrawingTracer.h + src/DrawingTracer.cc + src/HTMLState.h + src/HTMLTextLine.h + src/HTMLTextLine.cc + src/HTMLTextPage.h + src/HTMLTextPage.cc + src/Preprocessor.h + src/Preprocessor.cc + src/StringFormatter.h + src/StringFormatter.cc + src/TmpFiles.h + src/TmpFiles.cc ) + +add_executable(pdf2htmlEX ${PDF2HTMLEX_SRC}) target_link_libraries(pdf2htmlEX ${PDF2HTMLEX_LIBS}) +add_custom_target(pdf2htmlEX_resources ALL DEPENDS + ${CMAKE_SOURCE_DIR}/share/base.min.css + ${CMAKE_SOURCE_DIR}/share/fancy.min.css + ${CMAKE_SOURCE_DIR}/share/pdf2htmlEX.min.js + ) + +add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/share/pdf2htmlEX.min.js + COMMAND ${CMAKE_SOURCE_DIR}/share/build_js.sh + DEPENDS + ${CMAKE_SOURCE_DIR}/share/build_js.sh + ${CMAKE_SOURCE_DIR}/share/pdf2htmlEX.js + ) + +add_custom_command(OUTPUT + ${CMAKE_SOURCE_DIR}/share/base.min.css + ${CMAKE_SOURCE_DIR}/share/fancy.min.css + COMMAND ${CMAKE_SOURCE_DIR}/share/build_css.sh + DEPENDS + ${CMAKE_SOURCE_DIR}/share/build_css.sh + ${CMAKE_SOURCE_DIR}/share/base.css + ${CMAKE_SOURCE_DIR}/share/fancy.css + ) + install (TARGETS pdf2htmlEX DESTINATION bin) -file (GLOB datafiles - share/base.css - share/jquery.js - share/pdf2htmlEX.js - share/manifest + +set(PDF2HTMLEX_RESOURCE + ${CMAKE_SOURCE_DIR}/3rdparty/PDF.js/compatibility.js + ${CMAKE_SOURCE_DIR}/3rdparty/PDF.js/compatibility.min.js + ${CMAKE_SOURCE_DIR}/share/base.css + ${CMAKE_SOURCE_DIR}/share/base.min.css + ${CMAKE_SOURCE_DIR}/share/fancy.css + ${CMAKE_SOURCE_DIR}/share/fancy.min.css + ${CMAKE_SOURCE_DIR}/share/LICENSE + ${CMAKE_SOURCE_DIR}/share/manifest + ${CMAKE_SOURCE_DIR}/share/pdf2htmlEX.js + ${CMAKE_SOURCE_DIR}/share/pdf2htmlEX.min.js + ${CMAKE_SOURCE_DIR}/share/pdf2htmlEX-64x64.png ) -install (FILES ${datafiles} DESTINATION share/pdf2htmlEX) +install (FILES ${PDF2HTMLEX_RESOURCE} DESTINATION share/pdf2htmlEX) install (FILES pdf2htmlEX.1 DESTINATION share/man/man1) + +## tests: + +set(PDF2HTMLEX_PATH ${CMAKE_BINARY_DIR}/pdf2htmlEX) +set(PDF2HTMLEX_TMPDIR /tmp/pdf2htmlEX/tmp) +set(PDF2HTMLEX_DATDIR /tmp/pdf2htmlEX/dat) +set(PDF2HTMLEX_PNGDIR /tmp/pdf2htmlEX/png) +set(PDF2HTMLEX_OUTDIR /tmp/pdf2htmlEX/out) +file(MAKE_DIRECTORY ${PDF2HTMLEX_TMPDIR}) +file(MAKE_DIRECTORY ${PDF2HTMLEX_DATDIR}) +file(MAKE_DIRECTORY ${PDF2HTMLEX_PNGDIR}) +file(MAKE_DIRECTORY ${PDF2HTMLEX_OUTDIR}) +configure_file(${CMAKE_SOURCE_DIR}/test/test.py.in ${CMAKE_SOURCE_DIR}/test/test.py) + +include(CTest) +add_test(test_basic python ${CMAKE_SOURCE_DIR}/test/test_output.py) +add_test(test_browser python ${CMAKE_SOURCE_DIR}/test/test_local_browser.py) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..72508e2fe --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,143 @@ +This is a general guide if you want to report bugs, ask questions, +request features or submitting patches. +Please take a moment to review this document in order to make the +process easy and effective for everyone involved. + +This document is adapted from [necolas/issue-guidelines](https://github.com/necolas/issue-guidelines) + +## Table of Contents +- [Channels](#channels) + - [The Issue Tracker](#the-issue-tracker) + - [The Mailing List](#the-mailing-list) + - [Contacting the Author](#contacting-the-author) +- [Guidance](#guidance) + - [Ask Questions](#ask-questions) + - [Bug Reports](#bug-reports) + - [Feature Requests](#feature-requests) + - [Pull Requests](#pull-requests) + +*** +## Channels + +A few channels are available to reach the developers, please find the most proper one for your purpose. + +### The Issue Tracker + +The [Issue Tracker](https://github.com/coolwanglu/pdf2htmlEX/issues) +is the best way for +[bug reports](#bug-reports), +[features requests](#feature-requests) +and [submitting pull requests](#pull-requests). + +Please respect the following restrictions: +* Do not post personal support requests, (e.g How can I call pdf2htmlEX in Java?). Use the mailing list, or [Stack Overflow](http://stackoverflow.com) instead. +* Keep the discussion on topic and respect the opinions of others. +* Posts violating the above restrictions may be removed without any notification. + + +Issues may be closed due to the following reasons: +* Fixed +* Duplicate of other issues +* Invalid / Won't fix / Off topic +* Inactivity (for unconfirmed issues) +* Insufficient info (for unconfirmed issues) + +In the last two cases, you can reopen the issue when you can provide more information. + +### The Mailing List + +The [mailing list](https://groups.google.com/forum/#!forum/pdf2htmlex) is set up for discussion and announcements. +You are welcome to [ask any question](#ask-questions) about pdf2htmlEX there. +However do not report issues or submit patches there, since it's terrible to keep track of them. + +### Contacting the author + +pdf2htmlEX is mostly written and maintained by 王璐 (Lu Wang). +His email and twitter account can be found in +[README.md](https://github.com/coolwanglu/pdf2htmlEX/blob/master/README.md). + +Please post only messages that do not fit into the above channels, otherwise +note that he no longer replies with _Please post your question to the mailing list_ or _Please file an issue at GitHub_, consider your message already replied. + +Please expect a _long_ delay,since the messages are usually archived and checked on a regular basis. + +## Guidance + +Here are a few tips for different types of messages. +Lots of your time may be saved if you follow the guidelines. + +### Ask questions + +If you need any help or have issues using pdf2htmlEX, +follow the following steps to get it resolved as fast as possible: + +First of all, did you realize that your question might have been already answered in one of the following places? + +- [pdf2htmlEX Wiki](https://github.com/coolwanglu/pdf2htmlEX/wiki) +- The manpage (run `man pdf2htmlEX`) +- Old posts in the [mailing list](#the-mailing-list) or the [issue tracker](#the-issue-tracker) +- [Google](http://www.google.com/) +- [Stack Overflow](http://stackoverflow.com/) + +If you cannot find anything useful there, do not hesitate to post in the [mailing list](#the-mailing-list). +On the other hand, if you think it's something wrong about pdf2htmlEX, please [report a bug](#bug-reports) instead. + +It will help a lot if you provide detailed information as mentioned in the [Bug Reports](#bug-reports) section. + +### Bug Reports + +A bug is a demonstrable problem that is caused by the code in the repository. +A perfect bug report may help the developer to identify the cause and locate the problematic code quickly. +Bugs should always be reported to [the Issue Tracker](#the-issue-tracker). + +Before you report any bug: +- Use the latest git version of pdf2htmlEX, since the issue may have been already fixed. +- Search for previous issues (open or closed), to make sure that the issue has not been reported before. +- If pdf2htmlEX crashed, take a look at [this article](https://github.com/coolwanglu/pdf2htmlEX/wiki/Troubleshooting-Crashes). + +A good bug report shouldn't leave others needing to chase you up for more information. +The developers may be very familiar with the code base of pdf2htmlEX, +but they may not know anything about your environment or what steps you have done, +unless you have them stated. +Please try to be as detailed as possible in your report. +Good examples include: [#58](https://github.com/coolwanglu/pdf2htmlEX/issues/58), [#183](https://github.com/coolwanglu/pdf2htmlEX/issues/183) and [#226](https://github.com/coolwanglu/pdf2htmlEX/issues/226). + +If you are not sure, please try to answer the following questions: + +- What's your operating system? +- What's the version of pdf2htmlEX and depended libraries? (You can post the output of `pdf2htmlEX -v`) +- Which browser(s) are you using? +- What steps will reproduce the issue? — please try to remove unnecessary steps +- What's the result and what did you expect? — e.g. you can post screenshots +- What error messages did you see? +- What's the affected PDF file and which pages are causing the issue? Create a pull request on [this repo](https://github.com/coolwanglu/pdf2htmlEX-testcase). + +Especially for issues regarding building pdf2htmlEX: +- Which compiler are you using? +- What's the output of `cmake` and `make`? +- What's the content of `CMakeList.txt`? + + +### Feature requests + +Feature requests are welcome. But take a moment to find out whether your idea +fits with the scope and aims of the project. It's up to *you* to make a strong +case to convince the project's developers of the merits of this feature. Please +provide as much detail and context as possible. + +### Pull requests + +Good pull requests - patches, improvements, new features - are a fantastic +help. They should remain focused in scope and avoid containing unrelated +commits. + +**Please ask first** before embarking on any significant pull request (e.g. +implementing features, refactoring code, porting to a different language), +otherwise you risk spending a lot of time working on something that the +project's developers might not want to merge into the project. + +Please read [_Using Pull Requests_](https://help.github.com/articles/using-pull-requests/) +if you are new to pull requests. + +**IMPORTANT**: By submitting a patch, you agree to allow the project owner to +license your work under the same license as that used by the project. diff --git a/ChangeLog b/ChangeLog index 3a89c389c..6f885c8ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,17 +1,140 @@ -Latest v0.7 +v0.14.6 +2015.07.22 + +* Fixed Windows build +* Fixed crash when flattening non-CID fonts +* Handle OpenType subtype for FontFile3 +* New option for the JS viewer: `view_history_handler` + + +v0.13.6 +2015.04.29 + +* Use micro versions +* Do not support Poppler < 0.25.0 any more +* ENABLE_SVG is enabled by default +* Improved DrawingTracer +* Workarounds for chrome/webkit + +v0.12 +2014.07.24 + +* Recognize and hide covered text +* Proof mode that allows easy comparison of HTML and PDF +* Do not support Fontforge < 2.0.0 any more +* Output is now XHTML +* Other bug fixed and improvements +* New options + --process-annotation + --correct-text-visibility + --proof + --svg-node-count-limit + --svg-embed-bitmap +* Removed options + --css-draw + +v0.11 +2014.01.19 + +* Compress JS with closure-compiler +* Compress CSS with YUI Compressor +* jQuery removed +* Lots of JS code cleaning +* Enable global key handler by default +* Use WOFF by default +* Always generate TTF before the final output +* Fix CSS for loading-indicator +* Do not set style for global +* Improvements on the SVG output +* New options + --tmp-file-size-limit + --tmp-dir + +v0.10 +2013.10.17 + +* Lots of code cleaning +* Logo as loading indicator +* Add a logo +* Remove several CSS prefixes +* Background image optimization +* Support output background image in JPEG (--bg-format jpg) +* [Experimental] Support output background image in SVG (--bg-format svg) +* [Experimental] Support Type 3 fonts +* New options + --bg-format + --font-format (same as --font-suffix, but without the leading dot) + --process-type3 +* Deprecated options: + --font-suffix + +v0.9 +2013.09.16 + +* Lazy loading of pages +* Show font names in debug messages +* Licensed changed + - Additional terms for usage in online services + - Remove GPLv2 +* Bug fixes: + - --optimize-text + - Always use Unicode encoding for fonts + - space width + - disable ligature in Firefox + - Uninitialized memory for encoding +* New options: + --embed + --embed-*** + --override-fstype +* Deprecated/Removed options: + --single-html + --remove-unused-glyph + +v0.8 +2013.05.05 + +* HTML optimization + - reduce number of elements + - merge lines with different y values + - merge lines with different (but proportional) transform matrices +* Custom format for page file name +* Workaround for NBSP +* A default HTML file which load the pages dynamically when split-pages is on +* Support simple clippings +* Bug fixed: + - missing glyphs in TTF fonts + - unexpected vertical shifts + - whitespace lost in IE +* New UI style +* New options: + --optimize-text : HTML optimization, see above + --fallback : the most accurate way, but costly (larger file sizes) + --printing : enable or disable CSS for printing + --page-file: specify page filenames when split-pages is on +* Deprecated options: + --embed-base-font +* New default values: + --embed-external-font 1 + --space-as-offset 0 + --remove-unused-glyph 0 + +v0.7 +2013.03.01 * Process outline * Fix build with poppler -* Many code cleaning jobs [John Hewson] +* Many code cleaning jobs +* Experimental printing support +* Lots of code refinements v0.6 2013.01.26 -* new option --no-drm [John Hewson] -* Travis CI integration [John Hewson] +* new option --no-drm +* Travis CI integration * Add a class for 'left' * Fixed a bug of hashing/finding GfxRGB -* new option -v, --version [John Hewson] +* new option -v, --version * Render Type 3 fonts as image * New parameter: --use-cropbox * Progress indicator @@ -26,8 +149,7 @@ v0.5 * Fixed glyph width adjusting * Fixed a memory issue * Working on css-draw -* Working on integrating background-renderer, preparing for svg renderer in -the future +* Working on integrating background-renderer, preparing for svg renderer in the future v0.4 2012.09.26 diff --git a/INSTALL b/INSTALL new file mode 100644 index 000000000..64e4613ae --- /dev/null +++ b/INSTALL @@ -0,0 +1,3 @@ +For instructions of building the source code, visit: +https://github.com/coolwanglu/pdf2htmlEX/wiki/Building + diff --git a/LICENSE b/LICENSE index b3b9ade5b..0665c92ee 100644 --- a/LICENSE +++ b/LICENSE @@ -1,12 +1,13 @@ -pdf2htmlEX -Copyright (c) 2013,2013 Lu Wang and other contributors +pdf2htmlEX (https://github.com/coolwanglu/pdf2htmlEX) +Copyright (c) 2012-2014 Lu Wang and other contributors -Please credit pdf2htmlEX if you use it in your work, especially for commercial use. -Font extraction, conversion or redistribution may be illegal, please check your local laws. +pdf2htmlEX, as a whole package, is licensed under GPLv3 (or any later version). -Files: * -Copyright (c) 2013,2013 Lu Wang and other contributors -License: GPLv2 and GPLv3 +Files in share/ and logo/ are released under relaxed licenses, +read the respective `LICENSE` file in the folders for details. + +----- +GPLv3 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,53 +21,3 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . - - - -Files: share/* -Copyright (c) 2013,2013 Lu Wang and other contributors -License: MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -File: share/jquery.js -Copyright 2012 jQuery Foundation and other contributors -License: MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/LICENSE_GPLv2 b/LICENSE_GPLv2 deleted file mode 100644 index d159169d1..000000000 --- a/LICENSE_GPLv2 +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/README.md b/README.md index 93bd9f7ce..99232010a 100644 --- a/README.md +++ b/README.md @@ -1,139 +1,66 @@ -# pdf2htmlEX +pdf2htmlEX is no longer under active development. New maintainers are [wanted](http://pdf2htmlex.blogspot.ch/2016/12/looking-for-new-maintainer.html). -[![Build Status](https://travis-ci.org/coolwanglu/pdf2htmlEX.png?branch=master)](https://travis-ci.org/coolwanglu/pdf2htmlEX) +#![](http://coolwanglu.github.io/pdf2htmlEX/images/pdf2htmlEX-64x64.png) pdf2htmlEX -A beautiful demo is worth a thousand words: + +>一图胜千言
A beautiful demo is worth a thousand words -- **Typography**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/geneve.html) / [MediaFire](http://www.mediafire.com/view/?fqbc2d2o1kdz51a) / [Original](https://github.com/raphink/geneve_1564/raw/master/geneve_1564.pdf) -- **Formulas**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/cheat.html) / [MediaFire](http://www.mediafire.com/view/?84vdgrepkxclbq2) / [Original](http://www.tug.org/texshowcase/cheat.pdf) -- **Scientific Paper**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/demo.html) / [MediaFire](http://www.mediafire.com/view/?6po429kz9czcga2) / [Original](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.148.349&rep=rep1&type=pdf) -- **Full Circle Magazine**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/issue65_en.html) / [MediaFire](http://www.mediafire.com/view/?6hxmt94k2vppnpb) / [Original](http://dl.fullcirclemagazine.org/issue65_en.pdf) The 1st link might be slow -- **Chinese**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/chn.html) / [MediaFire](http://www.mediafire.com/view/?6550ldag9w0uuq3) / [Original](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) -- Try your own files on [MediaFire](http://www.mediafire.com), a free online storage service, which uses pdf2htmlEX for its PDF preview feature. - -## Introduction +- **Bible de Genève, 1564** (fonts and typography): [HTML](http://coolwanglu.github.io/pdf2htmlEX/demo/geneve.html) / [PDF](https://github.com/raphink/geneve_1564/releases/download/2015-07-08_01/geneve_1564.pdf) +- **Cheat Sheet** (math formulas): [HTML](http://coolwanglu.github.io/pdf2htmlEX/demo/cheat.html) / [PDF](http://www.tug.org/texshowcase/cheat.pdf) +- **Scientific Paper** (text and figures): [HTML](http://coolwanglu.github.io/pdf2htmlEX/demo/demo.html) / [PDF](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.148.349&rep=rep1&type=pdf) +- **Full Circle Magazine** (read while downloading): [HTML](http://coolwanglu.github.io/pdf2htmlEX/demo/issue65_en.html) / [PDF](http://dl.fullcirclemagazine.org/issue65_en.pdf) +- **Git Manual** (CJK support): [HTML](http://coolwanglu.github.io/pdf2htmlEX/demo/chn.html) / [PDF](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) pdf2htmlEX renders PDF files in HTML, utilizing modern Web technologies. -It aims to provide an accuracy rendering, while keeping optimized for Web display. - -pdf2htmlEX is best for text-based PDF files, for example scientific papers with complicated formulas and figures. -Text, fonts and formats are natively perserved in HTML such that you can still search and copy. -The generated HTML file is static, Javascript is not required. - -[Learn more](https://github.com/coolwanglu/pdf2htmlEX/wiki/Introduction) - -## Features - -* Precise, native text in HTML, which means - - You can select & copy & search - - Correct font & position & styles - - Proper reencoding - - Generated HTML file is of similar size as the original (uncompressed) PDF file -* Output modes - - Normal HTML - - All-in-one HTML - portable & easy to share - - One HTML per page - best for dynamic pages -* More PDF stuffs that you love - - Links - - Outline - -[Full list](https://github.com/coolwanglu/pdf2htmlEX/wiki/Feature-List) -[Compare with others](https://github.com/coolwanglu/pdf2htmlEX/wiki/Comparison) - -## Get started - -### Install - -Thanks to all packagers! - - * [Ubuntu PPA](https://launchpad.net/~coolwanglu/+archive/pdf2htmlex) by Lu Wang , not always up-to-date. - * [ArchLinux AUR](https://aur.archlinux.org/packages.php?ID=62426) by Arthur Titeica - * [Gentoo Overlay](http://gpo.zugaina.org/app-text/pdf2htmlex), gentoo-zh, mrueg or sunrise, by respective packagers. - * [Homebrew Formula](https://github.com/mxcl/homebrew/blob/master/Library/Formula/pdf2htmlex.rb) by Jamie Ly - * [Macports (local repo)](https://github.com/iapain/pdf2htmlEX-macport) by Deepak Thukral - * Windows [N/A](https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ#wiki-install-windows) - -### Build from source - -#### Dependency - -* CMake, pkg-config -* GNU Getopt -* compilers support C++11, for example - * GCC >= 4.4.6 - * I heard about successful build with Clang -* **poppler** with xpdf header >= 0.20.0 (compile with **--enable-xpdf-headers**) - * Install **libpng** (and headers) BEFORE you compile poppler if you want background images generated - * Install **poppler-data** if your want CJK support -* **fontforge** (with header files) - * git version is recommended to avoid annoying compilation issues -* [Optional] **ttfautohint** - * run pdf2htmlEX with **--external-hint-tool=ttfautohint** to enable it -* [For Windows] - * Cygwin - * or MinGW, with some modifications to pdf2htmlEX. See [pdf2htmlEX on TeX Wiki](http://oku.edu.mie-u.ac.jp/~okumura/texwiki/?pdf2htmlEX) (in Japanese), special thanks to Haruhiko Okumura - - -#### Compiling - - git clone --depth 1 git://github.com/coolwanglu/pdf2htmlEX.git - cd pdf2htmlEX - cmake . && make && sudo make install - -## Usage - - pdf2htmlEX /path/to/foobar.pdf - pdf2htmlEX --help - man pdf2htmlEX - -## FAQ - -* [Troubleshooting compilation errors](https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ#wiki-compile) -* [How can I help](https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ#wiki-help) -* [I want more features](https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ#wiki-feature_commission) -* [More about pdf2htmlEX](https://github.com/coolwanglu/pdf2htmlEX/wiki/) +Academic papers with lots of formulas and figures? Magazines with complicated layouts? No problem! -## LICENSE +pdf2htmlEX is also an [online publishing tool](http://coolwanglu.github.io/pdf2htmlEX/doc/tb108wang.html) which is flexible for many different use cases. -GPLv2 & GPLv3 for most part, MIT License for share/\* -Read LICENSE for detail. +Learn more about [who](https://github.com/coolwanglu/pdf2htmlEX/wiki/Use-Cases) and [why](https://github.com/coolwanglu/pdf2htmlEX/wiki/Introduction) should use pdf2htmlEX. -**pdf2htmlEX is totally free, please credit pdf2htmlEX if you use it** -**Please consider sponsoring it if you use it for commercial purpose** +### Features -**Font extraction, conversion or redistribution MAY BE ILLEGAL, please check your local laws** +* Native HTML text with precise font and location. +* Flexible output: all-in-one HTML or on demand page loading (needs JavaScript). +* Moderate file size, sometimes even smaller than PDF. +* Supporting links, outlines (bookmarks), printing, SVG background, Type 3 fonts and [more...](https://github.com/coolwanglu/pdf2htmlEX/wiki/Feature-List) -## [**Donate Now**](http://coolwanglu.github.com/pdf2htmlEX/donate.html) +[Compare to others](https://github.com/coolwanglu/pdf2htmlEX/wiki/Comparison) -pdf2htmlEX is maintained by one person in spare time, and it needs your help! +### Portals -## Contact + * [:house:Wiki Home](https://github.com/coolwanglu/pdf2htmlEX/wiki) + * [Download](https://github.com/coolwanglu/pdf2htmlEX/wiki/Download) & [Building](https://github.com/coolwanglu/pdf2htmlEX/wiki/Building) + * [Quick Start](https://github.com/coolwanglu/pdf2htmlEX/wiki/Quick-Start) + * [Report Issues / Ask for Help](https://github.com/coolwanglu/pdf2htmlEX/blob/master/CONTRIBUTING.md#guidance) + * [:question:FAQ](https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ) + * [:envelope:Mailing List](https://groups.google.com/forum/#!forum/pdf2htmlex) + * [:mahjong:中文邮件列表](https://groups.google.com/forum/#!forum/pdf2htmlex-cn) -* Mailing list - * You might want to try these useful resources first: `man pdf2htmlEX`, [wiki](https://github.com/coolwanglu/pdf2htmlEX/wiki) and [FAQ](https://github.com/coolwanglu/pdf2htmlEX/wiki/FAQ) +### LICENSE -* Lu Wang - * For personal enquiries only - * Accepting messages in **Chinese**, **English** or **Japanese**. +pdf2htmlEX, as a whole package, is licensed under GPLv3+. +Some resource files are released with relaxed licenses, read `LICENSE` for more details. -## Acknowledge +### Acknowledgements pdf2htmlEX is made possible thanks to the following projects: * [poppler](http://poppler.freedesktop.org/) * [Fontforge](http://fontforge.org/) -* [jQuery](http://jquery.com/) pdf2htmlEX is inspired by the following projects: -* pdftops & pdftohtml from poppler +* pdftohtml from poppler * MuPDF * PDF.js * Crocodoc * Google Doc -### Special Thanks +#### Special Thanks -* Hongliang Tian -* Wanmin Liu +* Hongliang Tian +* Wanmin Liu diff --git a/TODO b/TODO index 6ea8be27d..02d500d7c 100644 --- a/TODO +++ b/TODO @@ -1,26 +1,51 @@ -c++ classes for different states +Redesign textline + +save width in Textline, create new
in the middle + +link in outline: dest-detail vs hashtag + +split js files +position history stack (popstate) +scale limits +onresize +built in support for ttfautohint +beforeprint/afterprint +customevent + +more information on demo page: + - showing pdf2htmlEX home page + - link to other demos + - browser requirements + +pdf:miui +view hash + + - dots issue + - AdobeXML*.pdf + - font issue + - cjkmix2*.pdf + - space issue + - python简明*.pdf + - fix negative word-spacing for IE == Future: == Too difficult/complicated to implement: - - integrate splash/cairo - - naive support for image/drawing (SVG?) - - type 3 fonts (convert to SVG fonts?) - reflowable text/combine lines/unwrapping - - Printing + - multi-thread -Not enough motivated/Lazy - - argument auto-completion +Not enough motivation/Lazy + - commandline argument auto-completion - use absolute positioning for long whitespace - - color invert - detect duplicate base fonts when embedding - disable selection if we know unicode is wrong - check if we can add information to the font, and let browsers show ligatures automatically - - position history stack (popstate) - draw non-orthogonal lines with CSS - - rename single-html -> embed-font/image/css ... - - merge sub/sup into one line - - precise link dest: zoom + - precise link destination: zoom - multiple charcode mapped to a same glyph - - don't dump image when there is nothing - minimum line width of css drawing + - separate classes for annotations (such that we don't have to hide all css drawings for printing) + - Widget Annotation + - handle large negative letter space + - optimization levels + diff --git a/build_for_ppa.py b/build_for_ppa.py index 90ac1e74d..81dea7243 100755 --- a/build_for_ppa.py +++ b/build_for_ppa.py @@ -7,6 +7,9 @@ modified for pdf2htmlEX 2012.08.28 + +modified for general git repo +2013.05.30 """ @@ -15,50 +18,65 @@ import re import time -print 'Generating version...' +package='pdf2htmlex' +ppa_name='ppa:coolwanglu/pdf2htmlex' +supported_distributions=('precise', 'trusty') +dist_pattern=re.compile('|'.join(['\\) '+i for i in supported_distributions])) +archive_cmd='(rm CMakeCache.txt || true) && cmake . && make dist' +archive_suffix='.tar.bz2' +print 'Generating version...' try: - rev = open('.git/refs/heads/devv').read()[:5] + version = re.findall(r'set\(PDF2HTMLEX_VERSION\s*"([^"]*)"\)', open('CMakeLists.txt').read())[0] except: - print 'Cannot get revision number' + print 'Cannot get package name and version number' sys.exit(-1) -today_timestr = time.strftime('%Y%m%d%H%M') -package='pdf2htmlex' -projectname='pdf2htmlEX' try: - version = re.findall(r'set\(PDF2HTMLEX_VERSION\s*"([^"]*)"\)', open('CMakeLists.txt').read())[0] + rev = open('.git/refs/heads/master').read()[:5] except: - print 'Cannot get package name and version number' + print 'Cannot get revision number' sys.exit(-1) +projectdir=os.getcwd() +today_timestr = time.strftime('%Y%m%d%H%M') deb_version = version+'-1~git'+today_timestr+'r'+rev full_deb_version = deb_version+'-0ubuntu1' #check if we need to update debian/changelog -if re.findall(r'\(([^)]+)\)', open('debian/changelog').readline())[0] == full_deb_version: - print - print 'No need to update debian/changelog, skipping' -else: - print - print 'Writing debian/changelog' - if os.system('dch -v "%s"' % (full_deb_version,)) != 0: - print 'Failed when updating debian/changelog' +with open('debian/changelog') as f: + if re.findall(r'\(([^)]+)\)', f.readline())[0] == full_deb_version: + print + print 'No need to update debian/changelog, skipping' + else: + print + print 'Writing debian/changelog' + if os.system('dch -v "%s"' % (full_deb_version,)) != 0: + print 'Failed when updating debian/changelog' + sys.exit(-1) + +# changelog may have been updated, reopen it +with open('debian/changelog') as f: + #check dist mark of changelog + changelog = f.read() + m = dist_pattern.search(changelog) + if m is None or m.pos >= changelog.find('\n'): + print 'Cannot locate the dist name in the first line of changelog' sys.exit(-1) print -print 'Building...' +print 'Preparing build ...' # handling files -if os.system('(rm CMakeCache.txt || true) && cmake . && make dist') != 0: +if os.system(archive_cmd) != 0: print 'Failed in creating tarball' sys.exit(-1) -orig_tar_filename = package+'-'+version+'.tar.bz2' -if os.system('test -e %s && cp %s ../build-area' % (orig_tar_filename, orig_tar_filename)) != 0: +orig_tar_filename = package+'-'+version+archive_suffix +if os.system('test -e %s && cp %s ../build-area/' % (orig_tar_filename, orig_tar_filename)) != 0: print 'Cannot copy tarball file to build area' sys.exit(-1) -deb_orig_tar_filename = package+'_'+deb_version+'.orig.tar.bz2' +deb_orig_tar_filename = package+'_'+deb_version+'.orig'+archive_suffix try: os.chdir('../build-area') @@ -79,28 +97,38 @@ print 'Cannot enter project dir' sys.exit(-1) -os.system('cp -r ../../%s/debian .' % (projectname,)) +os.system('cp -r %s/debian .' % (projectdir,)) -# building -if os.system('debuild -S -sa') != 0: - print 'Failed in debuild' - sys.exit(-1) +for cur_dist in supported_distributions: + print + print 'Building for ' + cur_dist + ' ...' + # substitute distribution name + with open('debian/changelog', 'w') as f: + f.write(dist_pattern.sub('~%s1) %s' % (cur_dist, cur_dist), changelog, 1)) + + # building + if os.system('debuild -S -sa') != 0: + print 'Failed in debuild' + sys.exit(-1) -print -sys.stdout.write('Everything seems to be good so far, upload?(y/n)') -sys.stdout.flush() -ans = raw_input().lower() -while ans not in ['y', 'n']: - sys.stdout.write('I don\'t understand, enter \'y\' or \'n\':') + """ + print + sys.stdout.write('Everything seems to be good so far, upload?(y/n)') + sys.stdout.flush() ans = raw_input().lower() - -if ans == 'n': - print 'Skipped.' - sys.exit(0) - -if os.system('dput ppa:coolwanglu/%s ../%s' % (package, package+'_'+full_deb_version+'_source.changes')) != 0: - print 'Failed in uploading by dput' - sys.exit(-1) + while ans not in ['y', 'n']: + sys.stdout.write('I don\'t understand, enter \'y\' or \'n\':') + ans = raw_input().lower() + + if ans == 'n': + print 'Skipped.' + sys.exit(0) + """ + + print 'Uploading' + if os.system('dput %s ../%s' % (ppa_name, package+'_'+full_deb_version+'~'+cur_dist+'1_source.changes')) != 0: + print 'Failed in uploading by dput' + sys.exit(-1) print 'Build area not cleaned.' print 'All done. Cool!' diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index cedab7663..000000000 --- a/debian/changelog +++ /dev/null @@ -1,145 +0,0 @@ -pdf2htmlex (0.7-1~git201301292229r2595c-0ubuntu1) quantal; urgency=low - - * Fixed a CSS issue - - -- WANG Lu Tue, 29 Jan 2013 22:29:21 +0800 - -pdf2htmlex (0.7-1~git201301282229r2595c-0ubuntu1) quantal; urgency=low - - * Process PDF Outline - - -- WANG Lu Mon, 28 Jan 2013 22:29:35 +0800 - -pdf2htmlex (0.7-1~git201301261427r2595c-0ubuntu1) quantal; urgency=low - - * New version, see Changelog for changelog - - -- WANG Lu Sat, 26 Jan 2013 14:27:18 +0800 - -pdf2htmlex (0.6-1~git201212182148rd76af-0ubuntu1) quantal; urgency=low - - * fix dependency of poppler for quantal - - -- WANG Lu Tue, 18 Dec 2012 21:48:35 +0800 - -pdf2htmlex (0.6-1~git201212111844rd76af-0ubuntu1) quantal; urgency=low - - * Package for quantal - - -- WANG Lu Tue, 11 Dec 2012 18:44:44 +0800 - -pdf2htmlex (0.6-1~git201210070052rcb9a8-0ubuntu1) precise; urgency=low - - * New version - - -- WANG Lu Sun, 07 Oct 2012 00:52:42 +0800 - -pdf2htmlex (0.5-1~git201210051800rbaa37-0ubuntu1) precise; urgency=low - - * Regularly re-packing. - - -- WANG Lu Fri, 05 Oct 2012 18:00:48 +0800 - -pdf2htmlex (0.5-1~git201209270317r6fa14-0ubuntu1) precise; urgency=low - - * Regularly re-packing. - - -- WANG Lu Thu, 27 Sep 2012 03:17:02 +0800 - -pdf2htmlex (0.5-1~git201209261622r170a0-0ubuntu1) precise; urgency=low - - * new version - - -- WANG Lu Wed, 26 Sep 2012 16:22:50 +0800 - -pdf2htmlex (0.4-1~git201209241628r30aee-0ubuntu1) precise; urgency=low - - * Regularly re-packing. - - -- WANG Lu Mon, 24 Sep 2012 16:28:18 +0800 - -pdf2htmlex (0.4-1~git201209170124r8b4ec-0ubuntu1) precise; urgency=low - - * Regularly re-packing. - - -- WANG Lu Mon, 17 Sep 2012 01:24:29 +0800 - -pdf2htmlex (0.4-1~git201209162328r8b4ec-0ubuntu1) precise; urgency=low - - * Regularly re-packing. - - -- WANG Lu Sun, 16 Sep 2012 23:28:03 +0800 - -pdf2htmlex (0.3-1~git201209152353rf02e1-0ubuntu1) precise; urgency=low - - * Regularly re-packing. - - -- WANG Lu Sat, 15 Sep 2012 23:53:43 +0800 - -pdf2htmlex (0.3-1~git201209071504ra0de6-0ubuntu1) precise; urgency=low - - * fix build - * 0.3 comes with more bug fixed - - -- WANG Lu Fri, 07 Sep 2012 15:04:09 +0800 - -pdf2htmlex (0.2-3~git201209052329rbc256-0ubuntu1) precise; urgency=low - - * Change dependency of fontforge - - -- WANG Lu Wed, 05 Sep 2012 23:29:49 +0800 - -pdf2htmlex (0.2-3~git201209030158r926cf-0ubuntu1) precise; urgency=low - - * Fix dependency of libpoppler27 - - -- WANG Lu Mon, 03 Sep 2012 01:58:42 +0800 - -pdf2htmlex (0.2-3~git201209010002rfe7b3-0ubuntu1) precise; urgency=low - - * update license - - -- WANG Lu Sat, 01 Sep 2012 00:02:23 +0800 - -pdf2htmlex (0.2-3~git201208312351rd12b8-0ubuntu1) precise; urgency=low - - * 0.2dev, many bugs fixed - - -- WANG Lu Fri, 31 Aug 2012 23:51:57 +0800 - -pdf2htmlex (0.1-3~git201208281638r1addb-0ubuntu1) precise; urgency=low - - * Add debian files - - -- WANG Lu Tue, 28 Aug 2012 16:38:19 +0800 - -pdf2htmlex (0.1-3~git201208281523r80dc3-0ubuntu1) precise; urgency=low - - * Add dependency libpng - - -- WANG Lu Tue, 28 Aug 2012 15:22:22 +0800 - -pdf2htmlex (0.1-3~git201208281431r383b1-0ubuntu1) precise; urgency=low - - * Updated CMakeList.txt - - -- WANG Lu Tue, 28 Aug 2012 14:29:43 +0800 - -pdf2htmlex (0.1-3~git201208281420rc53d7-0ubuntu1) precise; urgency=low - - * Added config.h.in - - -- WANG Lu Tue, 28 Aug 2012 14:06:22 +0800 - -pdf2htmlex (0.1-3~git201208281356r5731e-0ubuntu1) precise; urgency=low - - * Fix version for package - - -- WANG Lu Tue, 28 Aug 2012 13:46:09 +0800 - -pdf2htmlex (0.1-1~git20120828rf083f-0ubuntu1) precise; urgency=low - - * Initial release. - - -- WANG Lu Tue, 28 Aug 2012 01:26:33 +0800 - diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 45a4fb75d..000000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/debian/control b/debian/control deleted file mode 100644 index 3aac4d60f..000000000 --- a/debian/control +++ /dev/null @@ -1,13 +0,0 @@ -Source: pdf2htmlex -Section: universe/web -Priority: extra -Maintainer: WANG Lu -Build-Depends: cmake (>= 2.6.0), pkg-config, debhelper (>= 8), libpoppler-dev (>= 0.20.3), libboost-filesystem-dev, libboost-program-options-dev, libpng12-dev, libfontforge-dev, libspiro-dev, python-dev -Standards-Version: 3.9.3 -Homepage: http://github.com/coolwanglu/pdf2htmlEX - -Package: pdf2htmlex -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libpoppler27 (>= 0.20.3) | libpoppler28, libboost-filesystem-dev, libboost-program-options-dev, libpng12-0, libfontforge1 -Description: Converts PDF to HTML without losing format - pdf2htmlEX converts PDF to HTML while retaining text, format & style as much as possible diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index b09342493..000000000 --- a/debian/copyright +++ /dev/null @@ -1,38 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: pdf2htmlEX -Upstream-Contact: WANG Lu . -Source: http://github.com/coolwanglu/pdf2htmlEX - -Files: * -Copyright: 2012 WANG Lu -License: GPL-2 or GPL-3 - -License: GPL-2 - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -License: GPL-3 - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index e77248175..000000000 --- a/debian/dirs +++ /dev/null @@ -1 +0,0 @@ -usr/bin diff --git a/debian/pdf2htmlex.README b/debian/pdf2htmlex.README deleted file mode 100644 index b43bf86b5..000000000 --- a/debian/pdf2htmlex.README +++ /dev/null @@ -1 +0,0 @@ -README.md diff --git a/debian/pdf2htmlex.TODO b/debian/pdf2htmlex.TODO deleted file mode 100644 index e69de29bb..000000000 diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 4f2c774f2..000000000 --- a/debian/rules +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/make -f -%: - dh $@ - diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index c3d9f2407..000000000 --- a/debian/source/format +++ /dev/null @@ -1,2 +0,0 @@ -3.0 (quilt) - diff --git a/logo/LICENSE b/logo/LICENSE new file mode 100644 index 000000000..343da784c --- /dev/null +++ b/logo/LICENSE @@ -0,0 +1,28 @@ +pdf2htmlEX logo +Copyright (c) 2013 Lu Wang + +License: Creative Commons Attribution 3.0 Unported + +You are free: + + to Share — to copy, distribute and transmit the work + to Remix — to adapt the work + to make commercial use of the work + +Under the following conditions: + + Attribution — You must attribute the work in the manner specified +by the author or licensor (but not in any way that suggests that they +endorse you or your use of the work). + +With the understanding that: + + Waiver — Any of the above conditions can be waived if you get permission from the copyright holder. + Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license. + Other Rights — In no way are any of the following rights affected by the license: + Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; + The author's moral rights; + Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights. + Notice—For any reuse or distribution, you must make clear to others the license terms of this work. +The best way to do that is with a link to http://creativecommons.org/licenses/by-sa/3.0/ + diff --git a/logo/LICENSE_CC-BY-3.0 b/logo/LICENSE_CC-BY-3.0 new file mode 100755 index 000000000..eaec46434 --- /dev/null +++ b/logo/LICENSE_CC-BY-3.0 @@ -0,0 +1,335 @@ +Creative Commons Attribution 3.0 Unported + +CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE +LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN +ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION +ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE +INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM +ITS USE. + +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE +COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY +COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS +AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE +TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY +BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS +CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND +CONDITIONS. + +1. Definitions + +a. "Adaptation" means a work based upon the Work, or upon the Work and +other pre-existing works, such as a translation, adaptation, derivative +work, arrangement of music or other alterations of a literary or +artistic work, or phonogram or performance and includes cinematographic +adaptations or any other form in which the Work may be recast, +transformed, or adapted including in any form recognizably derived from +the original, except that a work that constitutes a Collection will not +be considered an Adaptation for the purpose of this License. For the +avoidance of doubt, where the Work is a musical work, performance or +phonogram, the synchronization of the Work in timed-relation with a +moving image ("synching") will be considered an Adaptation for the +purpose of this License. + +b. "Collection" means a collection of literary or artistic works, such +as encyclopedias and anthologies, or performances, phonograms or +broadcasts, or other works or subject matter other than works listed in +Section 1(f) below, which, by reason of the selection and arrangement of +their contents, constitute intellectual creations, in which the Work is +included in its entirety in unmodified form along with one or more other +contributions, each constituting separate and independent works in +themselves, which together are assembled into a collective whole. A work +that constitutes a Collection will not be considered an Adaptation (as +defined above) for the purposes of this License. + +c. "Distribute" means to make available to the public the original and +copies of the Work or Adaptation, as appropriate, through sale or other +transfer of ownership. + +d. "Licensor" means the individual, individuals, entity or entities that +offer(s) the Work under the terms of this License. + +e. "Original Author" means, in the case of a literary or artistic work, +the individual, individuals, entity or entities who created the Work or +if no individual or entity can be identified, the publisher; and in +addition (i) in the case of a performance the actors, singers, +musicians, dancers, and other persons who act, sing, deliver, declaim, +play in, interpret or otherwise perform literary or artistic works or +expressions of folklore; (ii) in the case of a phonogram the producer +being the person or legal entity who first fixes the sounds of a +performance or other sounds; and, (iii) in the case of broadcasts, the +organization that transmits the broadcast. + +f. "Work" means the literary and/or artistic work offered under the +terms of this License including without limitation any production in the +literary, scientific and artistic domain, whatever may be the mode or +form of its expression including digital form, such as a book, pamphlet +and other writing; a lecture, address, sermon or other work of the same +nature; a dramatic or dramatico-musical work; a choreographic work or +entertainment in dumb show; a musical composition with or without words; +a cinematographic work to which are assimilated works expressed by a +process analogous to cinematography; a work of drawing, painting, +architecture, sculpture, engraving or lithography; a photographic work +to which are assimilated works expressed by a process analogous to +photography; a work of applied art; an illustration, map, plan, sketch +or three-dimensional work relative to geography, topography, +architecture or science; a performance; a broadcast; a phonogram; a +compilation of data to the extent it is protected as a copyrightable +work; or a work performed by a variety or circus performer to the extent +it is not otherwise considered a literary or artistic work. + +g. "You" means an individual or entity exercising rights under this +License who has not previously violated the terms of this License with +respect to the Work, or who has received express permission from the +Licensor to exercise rights under this License despite a previous +violation. + +h. "Publicly Perform" means to perform public recitations of the Work +and to communicate to the public those public recitations, by any means +or process, including by wire or wireless means or public digital +performances; to make available to the public Works in such a way that +members of the public may access these Works from a place and at a place +individually chosen by them; to perform the Work to the public by any +means or process and the communication to the public of the performances +of the Work, including by public digital performance; to broadcast and +rebroadcast the Work by any means including signs, sounds or images. + +i. "Reproduce" means to make copies of the Work by any means including +without limitation by sound or visual recordings and the right of +fixation and reproducing fixations of the Work, including storage of a +protected performance or phonogram in digital form or other electronic +medium. + +2. Fair Dealing Rights. Nothing in this License is intended to reduce, +limit, or restrict any uses free from copyright or rights arising from +limitations or exceptions that are provided for in connection with the +copyright protection under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, +Licensor hereby grants You a worldwide, royalty-free, non-exclusive, +perpetual (for the duration of the applicable copyright) license to +exercise the rights in the Work as stated below: + +a. to Reproduce the Work, to incorporate the Work into one or more +Collections, and to Reproduce the Work as incorporated in the +Collections; + +b. to create and Reproduce Adaptations provided that any such +Adaptation, including any translation in any medium, takes reasonable +steps to clearly label, demarcate or otherwise identify that changes +were made to the original Work. For example, a translation could be +marked "The original work was translated from English to Spanish," or a +modification could indicate "The original work has been modified."; + +c. to Distribute and Publicly Perform the Work including as incorporated +in Collections; and, + +d. to Distribute and Publicly Perform Adaptations. + +e. For the avoidance of doubt: + +i. Non-waivable Compulsory License Schemes. In those jurisdictions in +which the right to collect royalties through any statutory or compulsory +licensing scheme cannot be waived, the Licensor reserves the exclusive +right to collect such royalties for any exercise by You of the rights +granted under this License; + +ii. Waivable Compulsory License Schemes. In those jurisdictions in which +the right to collect royalties through any statutory or compulsory +licensing scheme can be waived, the Licensor waives the exclusive right +to collect such royalties for any exercise by You of the rights granted +under this License; and, + +iii. Voluntary License Schemes. The Licensor waives the right to collect +royalties, whether individually or, in the event that the Licensor is a +member of a collecting society that administers voluntary licensing +schemes, via that society, from any exercise by You of the rights +granted under this License. + +The above rights may be exercised in all media and formats whether now +known or hereafter devised. The above rights include the right to make +such modifications as are technically necessary to exercise the rights +in other media and formats. Subject to Section 8(f), all rights not +expressly granted by Licensor are hereby reserved. + + +4. Restrictions. The license granted in Section 3 above is expressly +made subject to and limited by the following restrictions: + +a. You may Distribute or Publicly Perform the Work only under the terms +of this License. You must include a copy of, or the Uniform Resource +Identifier (URI) for, this License with every copy of the Work You +Distribute or Publicly Perform. You may not offer or impose any terms on +the Work that restrict the terms of this License or the ability of the +recipient of the Work to exercise the rights granted to that recipient +under the terms of the License. You may not sublicense the Work. You +must keep intact all notices that refer to this License and to the +disclaimer of warranties with every copy of the Work You Distribute or +Publicly Perform. When You Distribute or Publicly Perform the Work, You +may not impose any effective technological measures on the Work that +restrict the ability of a recipient of the Work from You to exercise the +rights granted to that recipient under the terms of the License. This +Section 4(a) applies to the Work as incorporated in a Collection, but +this does not require the Collection apart from the Work itself to be +made subject to the terms of this License. If You create a Collection, +upon notice from any Licensor You must, to the extent practicable, +remove from the Collection any credit as required by Section 4(b), as +requested. If You create an Adaptation, upon notice from any Licensor +You must, to the extent practicable, remove from the Adaptation any +credit as required by Section 4(b), as requested. + +b. If You Distribute, or Publicly Perform the Work or any Adaptations or +Collections, You must, unless a request has been made pursuant to +Section 4(a), keep intact all copyright notices for the Work and +provide, reasonable to the medium or means You are utilizing: (i) the +name of the Original Author (or pseudonym, if applicable) if supplied, +and/or if the Original Author and/or Licensor designate another party or +parties (e.g., a sponsor institute, publishing entity, journal) for +attribution ("Attribution Parties") in Licensor's copyright notice, +terms of service or by other reasonable means, the name of such party or +parties; (ii) the title of the Work if supplied; (iii) to the extent +reasonably practicable, the URI, if any, that Licensor specifies to be +associated with the Work, unless such URI does not refer to the +copyright notice or licensing information for the Work; and (iv) , +consistent with Section 3(b), in the case of an Adaptation, a credit +identifying the use of the Work in the Adaptation (e.g., "French +translation of the Work by Original Author," or "Screenplay based on +original Work by Original Author"). The credit required by this Section +4 (b) may be implemented in any reasonable manner; provided, however, +that in the case of a Adaptation or Collection, at a minimum such credit +will appear, if a credit for all contributing authors of the Adaptation +or Collection appears, then as part of these credits and in a manner at +least as prominent as the credits for the other contributing authors. +For the avoidance of doubt, You may only use the credit required by this +Section for the purpose of attribution in the manner set out above and, +by exercising Your rights under this License, You may not implicitly or +explicitly assert or imply any connection with, sponsorship or +endorsement by the Original Author, Licensor and/or Attribution Parties, +as appropriate, of You or Your use of the Work, without the separate, +express prior written permission of the Original Author, Licensor and/or +Attribution Parties. + +c. Except as otherwise agreed in writing by the Licensor or as may be +otherwise permitted by applicable law, if You Reproduce, Distribute or +Publicly Perform the Work either by itself or as part of any Adaptations +or Collections, You must not distort, mutilate, modify or take other +derogatory action in relation to the Work which would be prejudicial to +the Original Author's honor or reputation. Licensor agrees that in those +jurisdictions (e.g. Japan), in which any exercise of the right granted +in Section 3(b) of this License (the right to make Adaptations) would be +deemed to be a distortion, mutilation, modification or other derogatory +action prejudicial to the Original Author's honor and reputation, the +Licensor will waive or not assert, as appropriate, this Section, to the +fullest extent permitted by the applicable national law, to enable You +to reasonably exercise Your right under Section 3(b) of this License +(right to make Adaptations) but not otherwise. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR +OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY +KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, +INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, +FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF +LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, +WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE +EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE +LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR +ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES +ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS +BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + +a. This License and the rights granted hereunder will terminate +automatically upon any breach by You of the terms of this License. +Individuals or entities who have received Adaptations or Collections +from You under this License, however, will not have their licenses +terminated provided such individuals or entities remain in full +compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will +survive any termination of this License. + +b. Subject to the above terms and conditions, the license granted here +is perpetual (for the duration of the applicable copyright in the Work). +Notwithstanding the above, Licensor reserves the right to release the +Work under different license terms or to stop distributing the Work at +any time; provided, however that any such election will not serve to +withdraw this License (or any other license that has been, or is +required to be, granted under the terms of this License), and this +License will continue in full force and effect unless terminated as +stated above. + +8. Miscellaneous + +a. Each time You Distribute or Publicly Perform the Work or a +Collection, the Licensor offers to the recipient a license to the Work +on the same terms and conditions as the license granted to You under +this License. + +b. Each time You Distribute or Publicly Perform an Adaptation, Licensor +offers to the recipient a license to the original Work on the same terms +and conditions as the license granted to You under this License. + +c. If any provision of this License is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this License, and without further action +by the parties to this agreement, such provision shall be reformed to +the minimum extent necessary to make such provision valid and +enforceable. + +d. No term or provision of this License shall be deemed waived and no +breach consented to unless such waiver or consent shall be in writing +and signed by the party to be charged with such waiver or consent. This +License constitutes the entire agreement between the parties with +respect to the Work licensed here. There are no understandings, +agreements or representations with respect to the Work not specified +here. Licensor shall not be bound by any additional provisions that may +appear in any communication from You. + +e. This License may not be modified without the mutual written agreement +of the Licensor and You. + +f. The rights granted under, and the subject matter referenced, in this +License were drafted utilizing the terminology of the Berne Convention +for the Protection of Literary and Artistic Works (as amended on +September 28, 1979), the Rome Convention of 1961, the WIPO Copyright +Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and +the Universal Copyright Convention (as revised on July 24, 1971). These +rights and subject matter take effect in the relevant jurisdiction in +which the License terms are sought to be enforced according to the +corresponding provisions of the implementation of those treaty +provisions in the applicable national law. If the standard suite of +rights granted under applicable copyright law includes additional rights +not granted under this License, such additional rights are deemed to be +included in the License; this License is not intended to restrict the +license of any rights under applicable law. + + +Creative Commons Notice + +Creative Commons is not a party to this License, and makes no warranty +whatsoever in connection with the Work. Creative Commons will not be +liable to You or any party on any legal theory for any damages +whatsoever, including without limitation any general, special, +incidental or consequential damages arising in connection to this +license. Notwithstanding the foregoing two (2) sentences, if Creative +Commons has expressly identified itself as the Licensor hereunder, it +shall have all rights and obligations of Licensor. + +Except for the limited purpose of indicating to the public that the Work +is licensed under the CCPL, Creative Commons does not authorize the use +by either party of the trademark "Creative Commons" or any related +trademark or logo of Creative Commons without the prior written consent +of Creative Commons. Any permitted use will be in compliance with +Creative Commons' then-current trademark usage guidelines, as may be +published on its website or otherwise made available upon request from +time to time. For the avoidance of doubt, this trademark restriction +does not form part of this License. + +Creative Commons may be contacted at http://creativecommons.org/. diff --git a/logo/design.svg b/logo/design.svg new file mode 100644 index 000000000..3071c0732 --- /dev/null +++ b/logo/design.svg @@ -0,0 +1,221 @@ + + + + + pdf2htmlEX logo design + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + pdf2htmlEX logo design + + 2013-09-27 + + + Lu Wang <coolwanglu@gmail.com> + + + + + + + + + + + + + + + + + + <pdf> + + + + + diff --git a/logo/notes.txt b/logo/notes.txt new file mode 100644 index 000000000..7ec7b405d --- /dev/null +++ b/logo/notes.txt @@ -0,0 +1,9 @@ +logo memo + +convert everything to path +ungroup everything +union everything +crop canvas +update metadata +save as optimized svg +optimize for web using pngnq diff --git a/logo/pdf2htmlEX-256x256.png b/logo/pdf2htmlEX-256x256.png new file mode 100644 index 000000000..48746c709 Binary files /dev/null and b/logo/pdf2htmlEX-256x256.png differ diff --git a/logo/pdf2htmlEX-64x64.png b/logo/pdf2htmlEX-64x64.png new file mode 100644 index 000000000..51e2905cb Binary files /dev/null and b/logo/pdf2htmlEX-64x64.png differ diff --git a/logo/pdf2htmlEX.svg b/logo/pdf2htmlEX.svg new file mode 100644 index 000000000..57850363e --- /dev/null +++ b/logo/pdf2htmlEX.svg @@ -0,0 +1,42 @@ + + + +pdf2htmlEX logo + + + + + + + + + + + + + +image/svg+xml + +pdf2htmlEX logo + +2013-09-27 + + +Lu Wang <coolwanglu@gmail.com> + + + + + + + + + + + + + + + + + diff --git a/logo/update_png.sh b/logo/update_png.sh new file mode 100755 index 000000000..b952e627b --- /dev/null +++ b/logo/update_png.sh @@ -0,0 +1,8 @@ +#!/bin/sh -ex + +# convert raw SVG into png of different sizes +convert -background none -resize 64x64^ pdf2htmlEX.svg pdf2htmlEX-64x64.png +convert -background none -resize 256x256^ pdf2htmlEX.svg pdf2htmlEX-256x256.png +# optimize for web +pngnq pdf2htmlEX-64x64.png +mv pdf2htmlEX-64x64-nq8.png ../share/pdf2htmlEX-64x64.png diff --git a/pdf2htmlEX.1.in b/pdf2htmlEX.1.in index 715c13bd2..7df4614ec 100644 --- a/pdf2htmlEX.1.in +++ b/pdf2htmlEX.1.in @@ -15,9 +15,9 @@ .PP pdf2htmlEX is a utility that converts PDF files to HTML files. -pdf2htmlEX tries its best to render the PDF precisely, maintain proper styling, while retaining text and optmizing for Web. +pdf2htmlEX tries its best to render the PDF precisely, maintain proper styling, while retaining text and optimizing for Web. -Fonts are extracted form PDF and then embedded into HTML (Type 3 fonts are not supported). Text in the converted HTML file is usually selectable and copyable. +Fonts are extracted form PDF and then embedded into HTML, text in the converted HTML file is usually selectable and copyable. Other objects are rendered as images and also embedded. @@ -26,135 +26,201 @@ Other objects are rendered as images and also embedded. .SS Pages .TP -.B -f, --first-page (Default: 1) +.B \-f, \-\-first\-page (Default: 1) Specify the first page to process .TP -.B -l, --last-page (Default: last page) +.B \-l, \-\-last\-page (Default: last page) Specify the last page to process .SS Dimensions -.B --zoom , --fit-width , --fit-height ---zoom specifies the zoom factor directly; --fit-width/height specifies the maximum width/height of a page, the values are in pixels. +.TP +.B \-\-zoom , \-\-fit\-width , \-\-fit\-height +\-\-zoom specifies the zoom factor directly; \-\-fit\-width/height specifies the maximum width/height of a page, the values are in pixels. If multiple values are specified, the minimum one will be used. If none is specified, pages will be rendered as 72DPI. .TP -.B --use-cropbox <0|1> (Default: 0) +.B \-\-use\-cropbox <0|1> (Default: 1) Use CropBox instead of MediaBox for output. .TP -.B --hdpi , --vdpi (Default: 144) +.B \-\-hdpi , \-\-vdpi (Default: 144) Specify the horizontal and vertical DPI for images .SS Output -.TP -.B --single-html <0|1> (Default: 1) -Whether to embed everything into one HTML file. - -If switched off, there will be several files generated along with the HTML file including files for fonts, css, images. +.B \-\-embed +.br +.B \-\-embed\-css <0|1> (Default: 1) +.br +.B \-\-embed\-font <0|1> (Default: 1) +.br +.B \-\-embed\-image <0|1> (Default: 1) +.br +.B \-\-embed\-javascript <0|1> (Default: 1) +.br +.B \-\-embed\-outline <0|1> (Default: 1) +.RS +Specify which elements should be embedded into the output HTML file. -Note that the outline will always be embedded into the main HTML file no matter if this switch is on or not. -And only when this switch is off will there be a separate .outline file contains the outline. -You need to modify the manifest if you do not want outline embedded. +If switched off, separated files will be generated along with the HTML file for the corresponding elements. +\-\-embed accepts a string as argument. Each letter of the string must be one of `cCfFiIjJoO`, which corresponds +to one of the \-\-embed\-*** switches. Lower case letters for 0 and upper case letters for 1. For example, +`\-\-embed cFIJo` means to embed everything but CSS files and outlines. +.RE .TP -.B --split-pages <0|1> (Default: 0) -If turned on, pages will be stored into separated files named as 0.page, 1.page, ... +.B \-\-split\-pages <0|1> (Default: 0) +If turned on, the content of each page is stored in a separated file. -Also the css and outline will be stored into separated files, and the will be no .html generated. +This switch is useful if you want pages to be loaded separately & dynamically \-\- a supporting server might be necessary. -This switch is useful if you want pages to be loaded separately & dynamically -- in which case you need to compose the page yourself, and a supporting backend might be necessary. +Also see \-\-page\-filename. .TP -.B --dest-dir (Default: .) -Specify destination folder +.B \-\-dest\-dir (Default: .) +Specify destination folder. .TP -.B --css-filename (Default: ) +.B \-\-css\-filename (Default: ) Specify the filename of the generated css file, if not embedded. If it's empty, the file name will be determined automatically. .TP -.B --outline-filename (Default: ) -Specify the filename of the generated outline file, if not embedded. +.B \-\-page\-filename (Default: ) +Specify the filename template for pages when \-\-split\-pages is 1 + +A %d placeholder may be included in `filename` to indicate where the page number should be placed. The placeholder supports a limited subset of normal numerical placeholders, including specified width and zero padding. + +If `filename` does not contain a placeholder for the page number, the page number will be inserted directly before the file extension. If the filename does not have an extension, the page number will be placed at the end of the file name. + +If \-\-page\-filename is not specified, will be used for the output filename, replacing the extension with .page and adding the page number directly before the extension. + +.B Examples + +.B pdf2htmlEX \-\-split\-pages 1 foo.pdf + + Yields page files foo1.page, foo2.page, etc. + +.B pdf2htmlEX \-\-split\-pages 1 foo.pdf \-\-page\-filename bar.baz + + Yields page files bar1.baz, bar2.baz, etc. + +.B pdf2htmlEX \-\-split\-pages 1 foo.pdf \-\-page\-filename page%dbar.baz + + Yields page files page1bar.baz, page2bar.baz, etc. + +.B pdf2htmlEX \-\-split\-pages 1 foo.pdf \-\-page\-filename bar%03d.baz + + Yields page files bar001.baz, bar002.baz, etc. + +.TP +.B \-\-outline\-filename (Default: ) +Specify the filename of the generated outline file, if not embedded. If it's empty, the file name will be determined automatically. .TP -.B --process-nontext <0|1> (Default: 1) -Whether to process non-text objects (as images) +.B \-\-process\-nontext <0|1> (Default: 1) +Whether to process non\-text objects (as images) .TP -.B --process-outline <0|1> (Default: 0) +.B \-\-process\-outline <0|1> (Default: 1) Whether to show outline in the generated HTML -.SS Fonts +.TP +.B \-\-process-annotation <0|1> (Default: 0) +Whether to show annotation in the generated HTML .TP -.B --embed-base-font <0|1> (Default: 1) -Whether to embed base 14 fonts. +.B \-\-process-form <0|1> (Default: 0) +Whether to include text fields and radio buttons in the generated HTML -There are several base font defined in PDF standards, which are supposed to be provided by the PDF reader. +.TP +.B \-\-printing <0|1> (Default: 1) +Enable printing support. Disabling this option may reduce the size of CSS. -If this switch is on, local matched font will be used and embedded; otherwise only font names are exported such that web browsers may try to find proper fonts themselves. +.TP +.B \-\-fallback <0|1> (Default: 0) +Output in fallback mode, for better accuracy and browser compatibility, but the size becomes larger. .TP -.B --embed-external-font <0|1> (Default: 0) -Similar as above but for non-base fonts. +.B \-\-tmp\-file\-size\-limit (Default: \-1) +This limits the total size (in KB) of the temporary files which will also limit the total size of the output file. +This is an estimate and it will stop after a page, once the total temporary files size is greater than this number. + +\-1 means no limit and is the default. + + +.SS Fonts .TP -.B --font-suffix (Default: .ttf) -Specify the suffix of fonts extracted from the PDF file. +.B \-\-embed\-external\-font <0|1> (Default: 1) +Specify whether the local matched fonts, for fonts not embedded in PDF, should be embedded into HTML. + +If this switch is off, only font names are exported such that web browsers may try to find proper fonts themselves, and that might cause issues about incorrect font metrics. .TP -.B --decompose-ligature <0|1> (Default: 0) -Decompose ligatures. For example 'fi' -> 'f''i'. +.B \-\-font\-format (Default: woff) +Specify the format of fonts extracted from the PDF file. .TP -.B --remove-unused-glyph <0|1> (Default: 1) -If set to 1, remove unused glyphs in embedded fonts in order to reduce the file size. +.B \-\-decompose\-ligature <0|1> (Default: 0) +Decompose ligatures. For example 'fi' \-> 'f''i'. .TP -.B --auto-hint <0|1> (Default: 0) -If set to 1, hints will be generated for the fonts using fontforge. +.B \-\-auto\-hint <0|1> (Default: 0) +If set to 1, hints will be generated for the fonts using FontForge. -This may be preceded by --external-hint-tool. +This may be preceded by \-\-external\-hint\-tool. .TP -.B --external-hint-tool (Default: ) -If specified, the tool will be called in order to enhanced hinting for fonts, this will precede --auto-hint. +.B \-\-external\-hint\-tool (Default: ) +If specified, the tool will be called in order to enhanced hinting for fonts, this will precede \-\-auto\-hint. -The tool will be called as ' ', where suffix will be the same as specified for --font-suffix. +The tool will be called as ' ', where suffix will be the same as specified for \-\-font\-format. .TP -.B --stretch-narrow-glyph <0|1> (Default: 0) +.B \-\-stretch\-narrow\-glyph <0|1> (Default: 0) If set to 1, glyphs narrower than described in PDF will be stretched; otherwise space will be padded to the right of the glyphs .TP -.B --squeeze-wide-glyph <0|1> (Default: 1) +.B \-\-squeeze\-wide\-glyph <0|1> (Default: 1) If set to 1, glyphs wider than described in PDF will be squeezed; otherwise it will be truncated. +.TP +.B \-\-override\-fstype <0|1> (Default: 0) +Clear the fstype bits in TTF/OTF fonts. + +Turn this on if Internet Explorer complains about 'Permission must be Installable' AND you have permission to do so. + +.TP +.B \-\-process\-type3 <0|1> (Default: 0) +If turned on, pdf2htmlEX will try to convert Type 3 fonts such that text can be rendered natively in HTML. +Otherwise all text with Type 3 fonts will be rendered as image. + +This feature is highly experimental. + .SS Text .TP -.B --heps , --veps (Default: 1) +.B \-\-heps , \-\-veps (Default: 1) Specify the maximum tolerable horizontal/vertical offset (in pixels). pdf2htmlEX would try to optimize the generated HTML file moving Text within this distance. .TP -.B --space-threshold (Default: 1.0/6) +.B \-\-space\-threshold (Default: 0.125) pdf2htmlEX would insert a whitespace character ' ' if the distance between two consecutive letters in the same line is wider than ratio * font_size. .TP -.B --font-size-multiplier (Default: 4.0) +.B \-\-font\-size\-multiplier (Default: 4.0) Many web browsers limit the minimum font size, and many would round the given font size, which results in incorrect rendering. Specify a ratio greater than 1 would resolve this issue, however it might freeze some browsers. @@ -162,88 +228,128 @@ Specify a ratio greater than 1 would resolve this issue, however it might freeze For some versions of Firefox, however, there will be a problem when the font size is too large, in which case a smaller value should be specified here. .TP -.B --space-as-offset <0|1> (Default: 0) -Treat space characters as offsets, which may increase the size of the output. +.B \-\-space\-as\-offset <0|1> (Default: 0) +If set to 1, space characters will be treated as offsets, which allows a better optimization. -Turn it on if space characters are not displayed correctly, or you want to remove positional spaces. +For PDF files with bad encodings, turning on this option may cause losing characters. .TP -.B --tounicode <-1|0|1> (Default: 0) +.B \-\-tounicode <\-1|0|1> (Default: 0) A ToUnicode map may be provided for each font in PDF which indicates the 'meaning' of the characters. However often there is better "ToUnicode" info in Type 0/1 fonts, and sometimes the ToUnicode map provided is wrong. - If this value is set to 1, the ToUnicode Map is always applied, if provided in PDF, and characters may not render correctly in HTML if there are collisions. -If set to -1, a customized map is used such that rendering will be correct in HTML (visually the same), but you may not get correct characters by select & copy & paste. +If set to \-1, a customized map is used such that rendering will be correct in HTML (visually the same), but you may not get correct characters by select & copy & paste. If set to 0, pdf2htmlEX would try its best to balance the two methods above. +.TP +.B \-\-optimize\-text <0|1> (Default: 0) +If set to 1, pdf2htmlEX will try to reduce the number of HTML elements used for text. Turn it off if anything goes wrong. + +.TP +.B --correct-text-visibility <0|1> (Default: 0) +If set to 1, pdf2htmlEX will try to detect texts covered by other graphics and properly arrange them, +i.e. covered texts are made transparent in text layer, and are drawn on background layer. + +.SS Background Image + +.TP +.B \-\-bg\-format (Default: png) +Specify the background image format. Run `pdf2htmlEX \-v` to check all supported formats. + +.TP +.B \-\-svg\-node\-count\-limit (Default: -1) +If node count in a svg background image exceeds this limit, fall back this page to bitmap background; negative value means no limit. +This option is only useful when '\-\-bg\-format svg' is specified. Note that node count in svg is just calculated approximately. + +.TP +.B \-\-svg\-embed\-bitmap <0|1> (Default: 1) +Whether embed bitmaps in svg background image. 1: embed bitmaps in svg background; 0: dump bitmaps to external files if possible. + +This option is only useful when '\-\-bg\-format svg' is specified and '\-\-embed\-image' is off. + +Currently, RGB or Gray JPEG bitmaps in a PDF can be dumped, while those in other formats or colorspaces are still embedded. +If bitmaps are not dumped as expected, try pre-processing your PDF by ghostscript or acrobat and make sure bitmaps in it are converted to RGB/Gray JPEG format. See the project wiki for more details. + .SS PDF Protection .TP -.B -o, --owner-password +.B \-o, \-\-owner\-password Specify owner password .TP -.B -u, --user-password +.B \-u, \-\-user\-password Specify user password .TP -.B --no-drm <0|1> (Default: 0) +.B \-\-no\-drm <0|1> (Default: 0) Override document DRM settings +Turn this on only when you have permission. + .SS Misc. .TP -.B --clean-tmp <0|1> (Default: 1) +.B \-\-clean\-tmp <0|1> (Default: 1) If switched off, intermediate files won't be cleaned in the end. .TP -.B --data-dir (Default: @CMAKE_INSTALL_PREFIX@/share/pdf2htmlEX) +.B \-\-data\-dir (Default: @CMAKE_INSTALL_PREFIX@/share/pdf2htmlEX) Specify the folder holding the manifest and other files (see below for the manifest file)` .TP -.B --css-draw <0|1> (Default: 0) +.B \-\-tmp\-dir (Default: /tmp or $TMPDIR if set) +Specify the temporary folder to use for temporary files + +.TP +.B \-\-css\-draw <0|1> (Default: 0) Experimental and unsupported CSS drawing .TP -.B --debug <0|1> (Default: 0) +.B \-\-debug <0|1> (Default: 0) Print debug information. +.TP +.B \-\-proof <0|1|2> (Default: 0) +Output a proof version. If a positive value is specified, texts are drawn on both text layer and background image for comparison. +If 2 is specified, texts on background are in different colors. If png/jpg background format is used, +a higher hdpi/vdpi (e.g. 288) is recommended for legibility. + .SS Meta .TP -.B -v, --version +.B \-v, \-\-version Print copyright and version info .TP -.B --help +.B \-\-help Print usage information -.SH MANIFEST and DATA-DIR -When split-pages is 0, the manifest file describes how the final html page should be generated. +.SH MANIFEST and DATA\-DIR +When split\-pages is 0, the manifest file describes how the final html page should be generated. -By default, pdf2htmlEX will use the manifest in the default data-dir (run `pdf2htmlEX -v` to check), which gives a simple demo of its syntax. +By default, pdf2htmlEX will use the manifest in the default data\-dir (run `pdf2htmlEX \-v` to check), which gives a simple demo of its syntax. -You can modify the default one, or you can create a new one and specify the correct data-dir in the command line. +You can modify the default one, or you can create a new one and specify the correct data\-dir in the command line. -When single-html is 1, all files referred by the manifest must be located in the data-dir. +All files referred by the manifest must be located in the data\-dir. .SH EXAMPLE .TP .B pdf2htmlEX /path/to/file.pdf Convert file.pdf into file.html .TP -.B pdf2htmlEX --clean-tmp 0 --debug 1 /path/to/file.pdf +.B pdf2htmlEX \-\-clean\-tmp 0 \-\-debug 1 /path/to/file.pdf Convert file.pdf and leave all intermediate files. .TP -.B pdf2htmlEX --dest-dir out --single-html 0 /path/to/file.pdf +.B pdf2htmlEX \-\-dest\-dir out \-\-embed fi /path/to/file.pdf Convert file.pdf into out/file.html and leave font/image files separated. .SH COPYRIGHT .PP Copyright 2012,2013 Lu Wang -pdf2htmlEX is GPLv2 & GPLv3 dual licensed +pdf2htmlEX is licensed under GPLv3 with additional terms, read LICENSE for details. .SH AUTHOR .PP @@ -252,4 +358,7 @@ pdf2htmlEX is written by Lu Wang .SH SEE ALSO .TP Home page -http://github.com/coolwanglu/pdf2htmlEX +https://github.com/coolwanglu/pdf2htmlEX +.TP +pdf2htmlEX Wiki +https://github.com/coolwanglu/pdf2htmlEX/wiki diff --git a/share/LICENSE b/share/LICENSE index 33a39845e..d7c272481 100644 --- a/share/LICENSE +++ b/share/LICENSE @@ -1,10 +1,8 @@ -All files in this directory are licensed under MIT License - Files: * -Copyright (c) 2013,2013 Lu Wang and other contributors +Copyright (c) 2012,2013 Lu Wang and other contributors -File: jquery.js -Copyright 2012 jQuery Foundation and other contributors +SVG patterns used in fancy.css +Copyright (c) 2011 Lea Verou, http://lea.verou.me/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/share/base.css b/share/base.css deleted file mode 100644 index d96d98be7..000000000 --- a/share/base.css +++ /dev/null @@ -1,152 +0,0 @@ -/* Base CSS */ -/* Copyright 2012 Lu Wang */ -#pdf-outline { /* PDF Outline */ - position:absolute; - top:0; - left:0; - bottom:0; - width:193px; - overflow:auto; - margin:0px; - padding:0 0 0 7px; - background-color:#707070; - display:none; -} -#pdf-outline.opened { - display:block; -} -#pdf-outline ul { - margin-left:13px; - margin-right:3px; - padding-left:3px; -} -#pdf-outline li { - list-style-type:disc; - list-style-position:outside; -} -#pdf-outline a { - font-size:13px; - color:#e8e8e8; -} -#pdf-outline a:visited { - color:#e8e8e8; -} -#pdf-outline a:hover{ - color:#e8e8e8; -} -#pdf-outline a:active{ - color:#e8e8e8; -} -#pdf-main { /* PDF container */ - position:absolute; - top:0; - left:0px; - bottom:0; - right:0; - overflow:auto; - background-color:#808080; - /* margin & border-width have to be 0, - * otherwise pdf2htmlEX may not calculate the coordinates correctly - */ - margin:0; - border-width:0; -} -#pdf-outline.opened + #pdf-main { - left:200px; -} -/* - * The followings are base classes, which are meant to be override by PDF specific classes - * So do not increase the specificity - */ -.d { /* page decoration */ - position:relative; - margin: 13px auto; - border-width: 0; - box-shadow: 1px 1px 3px 1px #333; - overflow: hidden; -} -.p { /* page */ - position:absolute; - top:0; - left:0; - width:100%; - height:100%; - background-color:white; - overflow: hidden; - /* margin & border-width have to be 0, - * otherwise pdf2htmlEX may not calculate the coordinates correctly - */ - margin:0; - border-width:0; -} -.b { /* content of a page */ - position:absolute; - border-width:0; - top:0; - left:0; - width:100%; - height:100%; - overflow:hidden; - display:block; - transform-origin:0% 0%; - -ms-transform-origin:0% 0%; - -moz-transform-origin:0% 0%; - -webkit-transform-origin:0% 0%; - -o-transform-origin:0% 0%; -} -.l { /* text line */ - position:absolute; - white-space:pre; - font-size:1px; - transform-origin:0% 100%; - -ms-transform-origin:0% 100%; - -moz-transform-origin:0% 100%; - -webkit-transform-origin:0% 100%; - -o-transform-origin:0% 100%; -} -span { - position:relative; - vertical-align: baseline; - /* _ for spaces may need display:inline, which will override this */ - display:inline-block; -} -._ { /* text shift */ - color:transparent; - z-index:-1; -} -::selection{ - background: rgba(127,255,255,1); -} -::-moz-selection{ - background: rgba(127,255,255,1); -} -.j { /* info for Javascript */ - display:none; -} -.a { -} -/* transparent color - Firefox, IE, etc. */ -.ct { /*fill*/ - color: white; -} -.Ct { /*stroke*/ - text-shadow: none; -} -/* transparent color - WebKit */ -@media screen and (-webkit-min-device-pixel-ratio:0) { - .ct { /*fill*/ - color: transparent; - } - .Ct { /*stroke*/ - -webkit-text-stroke: 0px transparent; - } -} -.Cd { /* css drawing */ - position:absolute; - transform-origin:0% 100%; - -ms-transform-origin:0% 100%; - -moz-transform-origin:0% 100%; - -webkit-transform-origin:0% 100%; - -o-transform-origin:0% 100%; -} -/* Base CSS END */ diff --git a/share/base.css.in b/share/base.css.in new file mode 100644 index 000000000..515134dc1 --- /dev/null +++ b/share/base.css.in @@ -0,0 +1,207 @@ +/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab filetype=css: */ +/*! + * Base CSS for pdf2htmlEX + * Copyright 2012,2013 Lu Wang + * https://github.com/coolwanglu/pdf2htmlEX/blob/master/share/LICENSE + */ +/* Part 1: Web Page Layout: Free to modify, except for a few of them which are required by pdf2htmlEX.js, see the comments */ +#sidebar { /* Sidebar */ + position:absolute; + top:0; + left:0; + bottom:0; + width:250px; + padding:0; + margin:0px; + overflow:auto; +} +#page-container { /* PDF container */ + position:absolute; /* required for calculating relative positions of pages in pdf2htmlEX.js */ + top:0; + left:0px; + margin:0; + padding:0; + border:0; /* required for lazy page loading in pdf2htmlEX.js (page visibility test) */ +} +@media screen { + /* for sidebar */ + #sidebar.opened + #page-container { left:250px; } + #page-container { + /* `bottom' and `right' are required for lazy page loading in pdf2htmlEX.js (page visibility test) + * alternatively you may set width and height + */ + bottom:0; + right:0; + overflow:auto; + } + .loading-indicator { + display:none; + } + .loading-indicator.active { + display:block; + position:absolute; + width:64px; + height:64px; + top:50%; + left:50%; + margin-top:-32px; + margin-left:-32px; + } + .loading-indicator img { + position:absolute; + top:0; + left:0; + bottom:0; + right:0; + } +} +@media print { + @page { margin:0; } + html { margin:0; } + body { + margin:0; + -webkit-print-color-adjust:exact; /* enable printing background images for WebKit */ + } + #sidebar { display:none; } + #page-container { + width:auto; + height:auto; + overflow:visible; + background-color:transparent; + } + .@CSS_CSS_DRAW_CN@ { display:none; } +} +/* Part 2: Page Elements: Modify with caution + * The followings are base classes, some of which are meant to be override by PDF specific classes + * So do not increase the specificity (e.g. ".classname" -> "#page-container .classname") + */ +.@CSS_PAGE_FRAME_CN@ { /* page */ + position:relative; + background-color:white; + overflow: hidden; + margin:0; + border:0; /* required by pdf2htmlEX.js for page visibility test */ +} +.@CSS_PAGE_CONTENT_BOX_CN@ { /* content of a page */ + position:absolute; + border:0; + padding:0; + margin:0; + top:0; + left:0; + width:100%; + height:100%; + overflow:hidden; + display:block; + /* set transform-origin for scaling */ + transform-origin:0% 0%; + -ms-transform-origin:0% 0%; + -webkit-transform-origin:0% 0%; +} +.@CSS_PAGE_CONTENT_BOX_CN@.opened { /* used by pdf2htmlEX.js, to show/hide pages */ + display:block; +} +.@CSS_FULL_BACKGROUND_IMAGE_CN@ { /* images that occupies the whole page */ + position:absolute; + border:0; + margin:0; + top:0; + bottom:0; + width:100%; + height:100%; + -ms-user-select:none; + -moz-user-select:none; + -webkit-user-select:none; + user-select:none; +} +.@CSS_BACKGROUND_IMAGE_CN@ { /* images that cover only a part of the page */ + position:absolute; + border:0; + margin:0; + -ms-user-select:none; + -moz-user-select:none; + -webkit-user-select:none; + user-select:none; +} +@media print { + .@CSS_PAGE_FRAME_CN@ { + margin:0; + box-shadow:none; + page-break-after:always; + page-break-inside:avoid; + } + @-moz-document url-prefix() { + /* fix page truncation for FireFox */ + .@CSS_PAGE_FRAME_CN@ { + overflow:visible; + border:1px solid #FFFFFF; + } + .@CSS_PAGE_CONTENT_BOX_CN@ {overflow:visible;} + } +} +.@CSS_CLIP_CN@ { /* clip box */ + position:absolute; + border:0; + padding:0; + margin:0; + overflow:hidden; + display:block; +} +.@CSS_LINE_CN@ { /* text line */ + position:absolute; + white-space:pre; + font-size:1px; + transform-origin:0% 100%; + -ms-transform-origin:0% 100%; + -webkit-transform-origin:0% 100%; + unicode-bidi:bidi-override;/* For rtl languages, e.g. Hebrew, we don't want the default Unicode behaviour */ + -moz-font-feature-settings:"liga" 0;/* We don't want Firefox to recognize ligatures */ +} +.@CSS_LINE_CN@:after { /* webkit #35443 */ + content: ''; +} +.@CSS_LINE_CN@:before { /* Workaround Blink(up to 41)/Webkit bug of word-spacing with leading spaces (chromium #404444 and pdf2htmlEX #412) */ + content: ''; + display: inline-block; +} +.@CSS_LINE_CN@ span { /* text blocks within a line */ + /* Blink(up to 41)/Webkit have bug with negative word-spacing and inline-block (pdf2htmlEX #416), so keep normal span inline. */ + position:relative; + unicode-bidi:bidi-override; /* For rtl languages, e.g. Hebrew, we don't want the default Unicode behaviour */ +} +.@CSS_WHITESPACE_CN@ { /* text shift */ + /* Blink(up to 41)/Webkit have bug with inline element, continuous spaces and word-spacing. Workaround by inline-block. */ + display: inline-block; + color: transparent; + z-index: -1; +} +/* selection background should not be opaque, for fallback mode */ +::selection{ + background: rgba(127,255,255,0.4); +} +::-moz-selection{ + background: rgba(127,255,255,0.4); +} +.@CSS_PAGE_DATA_CN@ { /* info for Javascript */ + display:none; +} +.@CSS_LINK_CN@ { /* annotation links */ +} +/* transparent color - WebKit */ +.@CSS_CSS_DRAW_CN@ { /* css drawing */ + position:absolute; + transform-origin:0% 100%; + -ms-transform-origin:0% 100%; + -webkit-transform-origin:0% 100%; +} +/* for the forms */ +.@CSS_INPUT_TEXT_CN@ { + border: none; + background-color: rgba(255, 255, 255, 0.0); +} + +.@CSS_INPUT_RADIO_CN@:hover { + cursor: pointer; +} + +/* Base CSS END */ diff --git a/share/build_css.sh b/share/build_css.sh new file mode 100755 index 000000000..98244cdd2 --- /dev/null +++ b/share/build_css.sh @@ -0,0 +1,25 @@ +#!/bin/sh -ex +# Compile and optimize CSS code +# Copyright 2013 Lu Wang + + +BASEDIR=$(dirname $0) +YUI_DIR="$BASEDIR/../3rdparty/yuicompressor" +YUI_JAR="$YUI_DIR/yuicompressor-2.4.8.jar" + +build () { + INPUT="$BASEDIR/$1" + OUTPUT="$BASEDIR/$2" + (echo "Building $OUTPUT with YUI Compressor" && \ + java -jar "$YUI_JAR" \ + --charset utf-8 \ + -o "$OUTPUT" \ + "$INPUT" && \ + echo 'Done.') || \ + (echo 'Failed. ' && \ + echo 'Using the uncompressed version.' && \ + cat "$INPUT" > "$OUTPUT") +} + +build "base.css" "base.min.css" +build "fancy.css" "fancy.min.css" diff --git a/share/build_js.sh b/share/build_js.sh new file mode 100755 index 000000000..a6e7d6156 --- /dev/null +++ b/share/build_js.sh @@ -0,0 +1,27 @@ +#!/bin/sh -ex +# Compile and optimize JS code +# Copyright 2013 Lu Wang + +# To enable closure-compiler, you need to install and configure JAVA environment +# Read 3rdparty/closure-compiler/README for details + + +BASEDIR=$(dirname $0) +CLOSURE_COMPILER_DIR="$BASEDIR/../3rdparty/closure-compiler" +CLOSURE_COMPILER_JAR="$CLOSURE_COMPILER_DIR/compiler.jar" +INPUT="$BASEDIR/pdf2htmlEX.js" +OUTPUT_FN="pdf2htmlEX.min.js" +OUTPUT="$BASEDIR/$OUTPUT_FN" + +(echo "Building $OUTPUT_FN with closure-compiler..." && \ + java -jar "$CLOSURE_COMPILER_JAR" \ + --compilation_level SIMPLE_OPTIMIZATIONS \ + --warning_level VERBOSE \ + --output_wrapper "(function(){%output%})();" \ + --js "$INPUT" \ + --js_output_file "$OUTPUT" && \ + echo 'Done.') || \ +(echo 'Failed. Read `3rdparty/closure-compiler/README` for more detail.' && \ +echo 'Using the uncompressed version.' && \ +cat "$INPUT" > "$OUTPUT") + diff --git a/share/fancy.css.in b/share/fancy.css.in new file mode 100644 index 000000000..bdba3f659 --- /dev/null +++ b/share/fancy.css.in @@ -0,0 +1,88 @@ +/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab filetype=css: */ +/*! + * Fancy styles for pdf2htmlEX + * Copyright 2012,2013 Lu Wang + * https://github.com/coolwanglu/pdf2htmlEX/blob/master/share/LICENSE + */ +@keyframes fadein { from { opacity:0;} to { opacity:1;} } +@-webkit-keyframes fadein { from { opacity:0;} to { opacity:1;} } +@keyframes swing { + 0% { transform: rotate(0deg); } + 10% { transform: rotate(0deg); } + 90% { transform: rotate(720deg); } + 100%{ transform: rotate(720deg); } +} +@-webkit-keyframes swing { + 0% { -webkit-transform: rotate(0deg); } + 10% { -webkit-transform: rotate(0deg); } + 90% { -webkit-transform: rotate(720deg); } + 100%{ -webkit-transform: rotate(720deg); } +} +@media screen { + #sidebar { + background-color:#2f3236; + /* modified from http://philbit.com/svgpatterns/#crossstripes */ + background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjNDAzYzNmIj48L3JlY3Q+CjxwYXRoIGQ9Ik0wIDBMNCA0Wk00IDBMMCA0WiIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2U9IiMxZTI5MmQiPjwvcGF0aD4KPC9zdmc+"); + } + #outline { + font-family:Georgia,Times,"Times New Roman",serif; + font-size:13px; + margin:2em 1em; + } + #outline ul { + padding:0; + } + #outline li { + list-style-type:none; + margin:1em 0; + } + #outline li > ul { + margin-left: 1em; + } + #outline a, + #outline a:visited, + #outline a:hover, + #outline a:active { + line-height:1.2; + color:#e8e8e8; + text-overflow:ellipsis; + white-space:nowrap; + text-decoration:none; + display:block; + overflow:hidden; + outline:0; + } + #outline a:hover { + color:rgb(0,204,255); + } + #page-container { + background-color:#9e9e9e; + /* http://philbit.com/svgpatterns/#thinstripes */ + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjUiPgo8cmVjdCB3aWR0aD0iNSIgaGVpZ2h0PSI1IiBmaWxsPSIjOWU5ZTllIj48L3JlY3Q+CjxwYXRoIGQ9Ik0wIDVMNSAwWk02IDRMNCA2Wk0tMSAxTDEgLTFaIiBzdHJva2U9IiM4ODgiIHN0cm9rZS13aWR0aD0iMSI+PC9wYXRoPgo8L3N2Zz4="); + -webkit-transition:left 500ms; + transition:left 500ms; + } + .@CSS_PAGE_FRAME_CN@ { + margin: 13px auto; + box-shadow: 1px 1px 3px 1px #333; + /* Needed by IE to make box-shadow works * https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow */ + border-collapse: separate; + } + .@CSS_PAGE_CONTENT_BOX_CN@.opened { /* used by pdf2htmlEX.js, to show/hide pages */ + -webkit-animation: fadein 100ms; + animation: fadein 100ms; + } + .loading-indicator.active { + /* + * use 0.01s instead of 0s, + * since YUI Compressor will change 0s to 0, + * which is not recognized by Firefox + */ + -webkit-animation: swing 1.5s ease-in-out 0.01s infinite alternate none; + animation: swing 1.5s ease-in-out 0.01s infinite alternate none; + } + .@CSS_RADIO_CHECKED_CN@ { + background: no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goQDSYgDiGofgAAAslJREFUOMvtlM9LFGEYx7/vvOPM6ywuuyPFihWFBUsdNnA6KLIh+QPx4KWExULdHQ/9A9EfUodYmATDYg/iRewQzklFWxcEBcGgEplDkDtI6sw4PzrIbrOuedBb9MALD7zv+3m+z4/3Bf7bZS2bzQIAcrmcMDExcTeXy10DAFVVAQDksgFUVZ1ljD3yfd+0LOuFpmnvVVW9GHhkZAQcxwkNDQ2FSCQyRMgJxnVdy7KstKZpn7nwha6urqqfTqfPBAJAuVymlNLXoigOhfd5nmeiKL5TVTV+lmIKwAOA7u5u6Lped2BsbOwjY6yf4zgQQkAIAcedaPR9H67r3uYBQFEUFItFtLe332lpaVkUBOHK3t5eRtf1DwAwODiIubk5DA8PM8bYW1EU+wEgCIJqsCAIQAiB7/u253k2BQDDMJBKpa4mEon5eDx+UxAESJL0uK2t7XosFlvSdf0QAEmlUnlRFJ9Waho2Qghc1/U9z3uWz+eX+Wr+lL6SZfleEAQIggA8z6OpqSknimIvYyybSCReMsZ6TislhCAIAti2Dc/zejVNWwCAavN8339j27YbTg0AGGM3WltbP4WhlRWq6Q/btrs1TVsYHx+vNgqKoqBUKn2NRqPFxsbGJzzP05puUlpt0ukyOI6z7zjOwNTU1OLo6CgmJyf/gA3DgKIoWF1d/cIY24/FYgOU0pp0z/Ityzo8Pj5OTk9PbwHA+vp6zWghDC+VSiuRSOQgGo32UErJ38CO42wdHR09LBQK3zKZDDY2NupmFmF4R0cHVlZWlmRZ/iVJUn9FeWWcCCE4ODjYtG27Z2Zm5juAOmgdGAB2d3cBADs7O8uSJN2SZfl+WKlpmpumaT6Yn58vn/fs6XmbhmHMNjc3tzDGFI7jYJrm5vb29sDa2trPC/9aiqJUy5pOp4f6+vqeJ5PJBAB0dnZe/t8NBajx/z37Df5OGX8d13xzAAAAAElFTkSuQmCC); + } +} +/* Fancy CSS END */ diff --git a/share/jquery.js b/share/jquery.js deleted file mode 100644 index e7f2a292b..000000000 --- a/share/jquery.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v@1.8.1 jquery.com | jquery.org/license */ -(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.1",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
t
",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j=0),h[l]&&j.push(k);j.length&&t.push({elem:f,matches:j})}n.length>o&&t.push({elem:this,matches:n.slice(o)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function $(a,b,c,d){c=c||[],b=b||q;var e,f,g,j,k=b.nodeType;if(k!==1&&k!==9)return[];if(!a||typeof a!="string")return c;g=h(b);if(!g&&!d)if(e=L.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&i(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return u.apply(c,t.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&X&&b.getElementsByClassName)return u.apply(c,t.call(b.getElementsByClassName(j),0)),c}return bk(a,b,c,d,g)}function _(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function ba(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bb(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bc(a,b,c,d){var e,g,h,i,j,k,l,m,n,p,r=!c&&b!==q,s=(r?"":"")+a.replace(H,"$1"),u=y[o][s];if(u)return d?0:t.call(u,0);j=a,k=[],m=0,n=f.preFilter,p=f.filter;while(j){if(!e||(g=I.exec(j)))g&&(j=j.slice(g[0].length),h.selector=l),k.push(h=[]),l="",r&&(j=" "+j);e=!1;if(g=J.exec(j))l+=g[0],j=j.slice(g[0].length),e=h.push({part:g.pop().replace(H," "),string:g[0],captures:g});for(i in p)(g=S[i].exec(j))&&(!n[i]||(g=n[i](g,b,c)))&&(l+=g[0],j=j.slice(g[0].length),e=h.push({part:i,string:g.shift(),captures:g}));if(!e)break}return l&&(h.selector=l),d?j.length:j?$.error(a):t.call(y(s,k),0)}function bd(a,b,e,f){var g=b.dir,h=s++;return a||(a=function(a){return a===e}),b.first?function(b){while(b=b[g])if(b.nodeType===1)return a(b)&&b}:f?function(b){while(b=b[g])if(b.nodeType===1&&a(b))return b}:function(b){var e,f=h+"."+c,i=f+"."+d;while(b=b[g])if(b.nodeType===1){if((e=b[o])===i)return b.sizset;if(typeof e=="string"&&e.indexOf(f)===0){if(b.sizset)return b}else{b[o]=i;if(a(b))return b.sizset=!0,b;b.sizset=!1}}}}function be(a,b){return a?function(c){var d=b(c);return d&&a(d===!0?c:d)}:b}function bf(a,b,c){var d,e,g=0;for(;d=a[g];g++)f.relative[d.part]?e=bd(e,f.relative[d.part],b,c):e=be(e,f.filter[d.part].apply(null,d.captures.concat(b,c)));return e}function bg(a){return function(b){var c,d=0;for(;c=a[d];d++)if(c(b))return!0;return!1}}function bh(a,b,c,d){var e=0,f=b.length;for(;e0?i(h,c,g):[]}function bj(a,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s=0,t=a.length,v=S.POS,w=new RegExp("^"+v.source+"(?!"+A+")","i"),x=function(){var a=1,c=arguments.length-2;for(;al){g+=k.slice(l,n.index),l=p,q=[c],J.test(g)&&(m&&(q=m),m=e);if(r=O.test(g))g=g.slice(0,-5).replace(J,"$&*"),l++;n.length>1&&n[0].replace(w,x),m=bi(g,n[1],n[2],q,m,r)}g=""}}o||(g+=k),o=!1}g?J.test(g)?bh(g,m||[c],d,e):$(g,c,d,e?e.concat(m):m):u.apply(d,m)}return t===1?d:$.uniqueSort(d)}function bk(a,b,e,g,h){a=a.replace(H,"$1");var i,k,l,m,n,o,p,q,r,s,v=bc(a,b,h),w=b.nodeType;if(S.POS.test(a))return bj(v,b,e,g);if(g)i=t.call(g,0);else if(v.length===1){if((o=t.call(v[0],0)).length>2&&(p=o[0]).part==="ID"&&w===9&&!h&&f.relative[o[1].part]){b=f.find.ID(p.captures[0].replace(R,""),b,h)[0];if(!b)return e;a=a.slice(o.shift().string.length)}r=(v=N.exec(o[0].string))&&!v.index&&b.parentNode||b,q="";for(n=o.length-1;n>=0;n--){p=o[n],s=p.part,q=p.string+q;if(f.relative[s])break;if(f.order.test(s)){i=f.find[s](p.captures[0].replace(R,""),r,h);if(i==null)continue;a=a.slice(0,a.length-q.length)+q.replace(S[s],""),a||u.apply(e,t.call(i,0));break}}}if(a){k=j(a,b,h),c=k.dirruns++,i==null&&(i=f.find.TAG("*",N.test(a)&&b.parentNode||b));for(n=0;m=i[n];n++)d=k.runs++,k(m)&&e.push(m)}return e}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=a.document,r=q.documentElement,s=0,t=[].slice,u=[].push,v=function(a,b){return a[o]=b||!0,a},w=function(){var a={},b=[];return v(function(c,d){return b.push(c)>f.cacheLength&&delete a[b.shift()],a[c]=d},a)},x=w(),y=w(),z=w(),A="[\\x20\\t\\r\\n\\f]",B="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",C=B.replace("w","w#"),D="([*^$|!~]?=)",E="\\["+A+"*("+B+")"+A+"*(?:"+D+A+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+C+")|)|)"+A+"*\\]",F=":("+B+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+E+")|[^:]|\\\\.)*|.*))\\)|)",G=":(nth|eq|gt|lt|first|last|even|odd)(?:\\(((?:-\\d)?\\d*)\\)|)(?=[^-]|$)",H=new RegExp("^"+A+"+|((?:^|[^\\\\])(?:\\\\.)*)"+A+"+$","g"),I=new RegExp("^"+A+"*,"+A+"*"),J=new RegExp("^"+A+"*([\\x20\\t\\r\\n\\f>+~])"+A+"*"),K=new RegExp(F),L=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,M=/^:not/,N=/[\x20\t\r\n\f]*[+~]/,O=/:not\($/,P=/h\d/i,Q=/input|select|textarea|button/i,R=/\\(?!\\)/g,S={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),NAME:new RegExp("^\\[name=['\"]?("+B+")['\"]?\\]"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+E),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+A+"*(even|odd|(([+-]|)(\\d*)n|)"+A+"*(?:([+-]|)"+A+"*(\\d+)|))"+A+"*\\)|)","i"),POS:new RegExp(G,"ig"),needsContext:new RegExp("^"+A+"*[>+~]|"+G,"i")},T=function(a){var b=q.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},U=T(function(a){return a.appendChild(q.createComment("")),!a.getElementsByTagName("*").length}),V=T(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),W=T(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),X=T(function(a){return a.innerHTML="",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),Y=T(function(a){a.id=o+0,a.innerHTML="
",r.insertBefore(a,r.firstChild);var b=q.getElementsByName&&q.getElementsByName(o).length===2+q.getElementsByName(o+0).length;return e=!q.getElementById(o),r.removeChild(a),b});try{t.call(r.childNodes,0)[0].nodeType}catch(Z){t=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}$.matches=function(a,b){return $(a,null,null,b)},$.matchesSelector=function(a,b){return $(b,null,null,[a]).length>0},g=$.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=g(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=g(b);return c},h=$.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},i=$.contains=r.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:r.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},$.attr=function(a,b){var c,d=h(a);return d||(b=b.toLowerCase()),f.attrHandle[b]?f.attrHandle[b](a):W||d?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},f=$.selectors={cacheLength:50,createPseudo:v,match:S,order:new RegExp("ID|TAG"+(Y?"|NAME":"")+(X?"|CLASS":"")),attrHandle:V?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:e?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:U?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(R,""),a[3]=(a[4]||a[5]||"").replace(R,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||$.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&$.error(a[0]),a},PSEUDO:function(a,b,c){var d,e;if(S.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(d=a[4])K.test(d)&&(e=bc(d,b,c,!0))&&(e=d.indexOf(")",d.length-e)-d.length)&&(d=d.slice(0,e),a[0]=a[0].slice(0,e)),a[2]=d;return a.slice(0,3)}},filter:{ID:e?function(a){return a=a.replace(R,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(R,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(R,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=x[o][a];return b||(b=x(a,new RegExp("(^|"+A+")"+a+"("+A+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=$.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return $.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=s++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[o]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[o]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e,g=f.pseudos[a]||f.pseudos[a.toLowerCase()];return g||$.error("unsupported pseudo: "+a),g[o]?g(b,c,d):g.length>1?(e=[a,a,"",b],function(a){return g(a,0,e)}):g}},pseudos:{not:v(function(a,b,c){var d=j(a.replace(H,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!f.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:v(function(a){return function(b){return(b.textContent||b.innerText||g(b)).indexOf(a)>-1}}),has:v(function(a){return function(b){return $(a,b).length>0}}),header:function(a){return P.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:_("radio"),checkbox:_("checkbox"),file:_("file"),password:_("password"),image:_("image"),submit:ba("submit"),reset:ba("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return Q.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e",a.querySelectorAll("[selected]").length||e.push("\\["+A+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="

",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+A+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bk=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return u.apply(f,t.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j,k,l,m=d.getAttribute("id"),n=m||o,p=N.test(a)&&d.parentNode||d;m?n=n.replace(c,"\\$&"):d.setAttribute("id",n),j=bc(a,d,h),n="[id='"+n+"']";for(k=0,l=j.length;k0})}(),f.setFilters.nth=f.setFilters.eq,f.filters=f.pseudos,$.attr=p.attr,p.find=$,p.expr=$.selectors,p.expr[":"]=p.expr.pseudos,p.unique=$.uniqueSort,p.text=$.getText,p.isXMLDoc=$.isXML,p.contains=$.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
","
"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{cj=f.href}catch(cy){cj=e.createElement("a"),cj.href="",cj=cj.href}ck=ct.exec(cj.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:cj,isLocal:cn.test(ck[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,ck[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==ck[1]&&i[2]==ck[2]&&(i[3]||(i[1]==="http:"?80:443))==(ck[3]||(ck[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cQ.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file diff --git a/share/manifest b/share/manifest index 7227a8c04..b03560fb6 100644 --- a/share/manifest +++ b/share/manifest @@ -1,72 +1,129 @@ # pdf2htmlEX manifest -# by WangLu -# 2012.09.12 +# Copyright (C) 2012,2013 Lu Wang # # Syntax # The first char of each line is the command # Empty lines are ignored # # # - comment -# @ - include a file from data dir +# @ - embed or link to a file from data dir, depending on the values of --embed-*** options # $ - special use for pdf2htmlEX # # Special # If a line contains """ only, all text until next """ will be included +# #TEST_IGNORE_BEGIN & #TEST_IGNORE_END are used for unittest +############# +# Declaration - Do not modify """ - - + + - + + """ -# base CSS styles -@base.css -# PDF specific CSS styles +############# +# Styles +# base CSS styles - Do not modify +@base.min.css + +# fancy CSS styles - Optional +@fancy.min.css + +# PDF specific CSS styles - Do not modify $css -# necessary Javascript codes -@jquery.js -@pdf2htmlEX.js -# entry point of pdf2htmlEX -""" - """ +#TEST_IGNORE_END + +############# +# Do not modify """ """ -# The container of outline +############# +# The sidebar # By default this is hidden, pdf2htmlEX.js will add the 'opened' class if it is not empty # You can add a class 'opened' here if you want it always opened or you don't use pdf2htmlEX.js # e.g. -#
+#