├── .gitignore ├── LICENSE ├── README.md ├── android ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ ├── android │ └── print │ │ └── PdfConverter.java │ └── com │ └── christopherdro │ └── htmltopdf │ ├── RNHTMLtoPDFModule.java │ └── RNHTMLtoPDFPackage.java ├── example ├── __tests__ │ ├── index.android.js │ └── index.ios.js ├── android │ ├── HTMLToPDF.iml │ ├── app │ │ ├── BUCK │ │ ├── app.iml │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── htmltopdf │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── index.android.js ├── index.ios.js ├── ios │ ├── HTMLToPDF.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── HTMLToPDF.xcscheme │ ├── HTMLToPDF │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── HTMLToPDFTests │ │ ├── HTMLToPDFTests.m │ │ └── Info.plist ├── package.json └── yarn.lock ├── index.js ├── ios ├── RNHTMLtoPDF.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── RNHTMLtoPDF │ ├── RNHTMLtoPDF.h │ └── RNHTMLtoPDF.m └── RNHTMLtoPDFTests │ └── Info.plist └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | #Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # node.js 46 | # 47 | node_modules/ 48 | npm-debug.log 49 | 50 | # Android/IJ 51 | .idea 52 | .gradle 53 | android/**/*.iml 54 | local.properties 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-html-to-pdf 2 | 3 | Convert html strings to PDF documents using React Native 4 | 5 | ## Installation 6 | 7 | 1. Run `npm install react-native-html-to-pdf --save` 8 | 9 | ### Option 1: Automatic 10 | 11 | 2. Run `react-native link` 12 | 13 | ### Option 2: Manual 14 | 15 | #### iOS 16 | 17 | 2. Open your project in XCode, right click on [Libraries](http://url.brentvatne.ca/jQp8) and select [Add Files to "Your Project Name](http://url.brentvatne.ca/1gqUD). 18 | 3. Add `libRNHTMLtoPDF.a` to `Build Phases -> Link Binary With Libraries` 19 | [(Screenshot)](http://url.brentvatne.ca/17Xfe). 20 | 21 | #### Android 22 | The android module pulls in iText to convert html to pdf. A license is required for commercial use. 23 | 24 | - Edit `android/settings.gradle` to included 25 | 26 | ```java 27 | include ':react-native-html-to-pdf' 28 | project(':react-native-html-to-pdf').projectDir = new File(rootProject.projectDir,'../node_modules/react-native-html-to-pdf/android') 29 | ``` 30 | 31 | - Edit `android/app/build.gradle` file to include 32 | 33 | ```java 34 | dependencies { 35 | .... 36 | compile project(':react-native-html-to-pdf') 37 | 38 | } 39 | ``` 40 | 41 | - Edit `MainApplication.java` to include 42 | 43 | ```java 44 | // import the package 45 | import com.christopherdro.htmltopdf.RNHTMLtoPDFPackage; 46 | 47 | // include package 48 | new MainReactPackage(), 49 | new RNHTMLtoPDFPackage() 50 | ``` 51 | 52 | ## Usage 53 | ```javascript 54 | 55 | import React, { Component } from 'react'; 56 | 57 | import { 58 | Text, 59 | TouchableHighlight, 60 | View, 61 | } = from 'react-native'; 62 | 63 | import RNHTMLtoPDF from 'react-native-html-to-pdf'; 64 | 65 | class Example extends Component { 66 | async createPDF() { 67 | let options = { 68 | html: '

PDF TEST

', 69 | fileName: 'test', 70 | directory: 'docs', 71 | }; 72 | 73 | let file = await RNHTMLtoPDF.convert(options) 74 | console.log(file.filePath); 75 | }, 76 | 77 | render() { 78 | 79 | 80 | Create PDF 81 | 82 | 83 | } 84 | } 85 | ``` 86 | 87 | ## Options 88 | 89 | | Param | Type | Default | Note | 90 | |---|---|---|---| 91 | | `html` | `string` | | HTML string to be converted 92 | | `fileName` | `string` | Random | Custom Filename excluding .pdf extension 93 | | `base64` | boolean | false | return base64 string of pdf file (not recommended) 94 | 95 | 96 | #### iOS Only 97 | 98 | | Param | Type | Default | Note | 99 | |---|---|---|---| 100 | | `height` | number | 612 | Set document height (points) 101 | | `width` | number | 792 | Set document width (points) 102 | | `padding` | number | 10 | Outer padding (points) 103 | 104 | 105 | ##### Android Only 106 | 107 | | Param | Type | Default | Note | 108 | |---|---|---|---| 109 | | `fonts` | Array | | Allow custom fonts `['/fonts/TimesNewRoman.ttf', '/fonts/Verdana.ttf']` 110 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | buildscript { 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | } 10 | } 11 | 12 | 13 | apply plugin: 'com.android.library' 14 | 15 | android { 16 | compileSdkVersion 25 17 | buildToolsVersion "25.0.1" 18 | 19 | defaultConfig { 20 | minSdkVersion 16 21 | targetSdkVersion 22 22 | versionCode 1 23 | versionName "1.0" 24 | ndk { 25 | abiFilters "armeabi-v7a", "x86" 26 | } 27 | } 28 | } 29 | 30 | repositories { 31 | mavenCentral() 32 | } 33 | 34 | 35 | dependencies { 36 | compile 'com.facebook.react:react-native:+' 37 | } 38 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/android/print/PdfConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created on 11/15/17. 3 | * Written by Islam Salah with assistance from members of Blink22.com 4 | */ 5 | 6 | package android.print; 7 | 8 | import android.content.Context; 9 | import android.os.Build; 10 | import android.os.Handler; 11 | import android.os.ParcelFileDescriptor; 12 | import android.util.Log; 13 | import android.webkit.WebView; 14 | import android.webkit.WebViewClient; 15 | 16 | import java.io.File; 17 | 18 | /** 19 | * Converts HTML to PDF. 20 | *

21 | * Can convert only one task at a time, any requests to do more conversions before 22 | * ending the current task are ignored. 23 | */ 24 | public class PdfConverter implements Runnable { 25 | 26 | private static final String TAG = "PdfConverter"; 27 | private static PdfConverter sInstance; 28 | 29 | private Context mContext; 30 | private String mHtmlString; 31 | private File mPdfFile; 32 | private PrintAttributes mPdfPrintAttrs; 33 | private boolean mIsCurrentlyConverting; 34 | private WebView mWebView; 35 | 36 | private PdfConverter() { 37 | } 38 | 39 | public static synchronized PdfConverter getInstance() { 40 | if (sInstance == null) 41 | sInstance = new PdfConverter(); 42 | 43 | return sInstance; 44 | } 45 | 46 | @Override 47 | public void run() { 48 | mWebView = new WebView(mContext); 49 | mWebView.setWebViewClient(new WebViewClient() { 50 | @Override 51 | public void onPageFinished(WebView view, String url) { 52 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) 53 | throw new RuntimeException("call requires API level 19"); 54 | else { 55 | PrintDocumentAdapter documentAdapter = mWebView.createPrintDocumentAdapter(); 56 | documentAdapter.onLayout(null, getPdfPrintAttrs(), null, new PrintDocumentAdapter.LayoutResultCallback() { 57 | }, null); 58 | documentAdapter.onWrite(new PageRange[]{PageRange.ALL_PAGES}, getOutputFileDescriptor(), null, new PrintDocumentAdapter.WriteResultCallback() { 59 | @Override 60 | public void onWriteFinished(PageRange[] pages) { 61 | destroy(); 62 | } 63 | }); 64 | } 65 | } 66 | }); 67 | mWebView.loadData(mHtmlString, "text/HTML", "UTF-8"); 68 | } 69 | 70 | public PrintAttributes getPdfPrintAttrs() { 71 | return mPdfPrintAttrs != null ? mPdfPrintAttrs : getDefaultPrintAttrs(); 72 | } 73 | 74 | public void setPdfPrintAttrs(PrintAttributes printAttrs) { 75 | this.mPdfPrintAttrs = printAttrs; 76 | } 77 | 78 | public void convert(Context context, String htmlString, File file) { 79 | if (context == null) 80 | throw new IllegalArgumentException("context can't be null"); 81 | if (htmlString == null) 82 | throw new IllegalArgumentException("htmlString can't be null"); 83 | if (file == null) 84 | throw new IllegalArgumentException("file can't be null"); 85 | 86 | if (mIsCurrentlyConverting) 87 | return; 88 | 89 | mContext = context; 90 | mHtmlString = htmlString; 91 | mPdfFile = file; 92 | mIsCurrentlyConverting = true; 93 | runOnUiThread(this); 94 | } 95 | 96 | private ParcelFileDescriptor getOutputFileDescriptor() { 97 | try { 98 | mPdfFile.createNewFile(); 99 | return ParcelFileDescriptor.open(mPdfFile, ParcelFileDescriptor.MODE_TRUNCATE | ParcelFileDescriptor.MODE_READ_WRITE); 100 | } catch (Exception e) { 101 | Log.d(TAG, "Failed to open ParcelFileDescriptor", e); 102 | } 103 | return null; 104 | } 105 | 106 | private PrintAttributes getDefaultPrintAttrs() { 107 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return null; 108 | 109 | return new PrintAttributes.Builder() 110 | .setMediaSize(PrintAttributes.MediaSize.NA_GOVT_LETTER) 111 | .setResolution(new PrintAttributes.Resolution("RESOLUTION_ID", "RESOLUTION_ID", 600, 600)) 112 | .setMinMargins(PrintAttributes.Margins.NO_MARGINS) 113 | .build(); 114 | 115 | } 116 | 117 | private void runOnUiThread(Runnable runnable) { 118 | Handler handler = new Handler(mContext.getMainLooper()); 119 | handler.post(runnable); 120 | } 121 | 122 | private void destroy() { 123 | mContext = null; 124 | mHtmlString = null; 125 | mPdfFile = null; 126 | mPdfPrintAttrs = null; 127 | mIsCurrentlyConverting = false; 128 | mWebView = null; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /android/src/main/java/com/christopherdro/htmltopdf/RNHTMLtoPDFModule.java: -------------------------------------------------------------------------------- 1 | package com.christopherdro.htmltopdf; 2 | 3 | import com.facebook.react.bridge.Arguments; 4 | import com.facebook.react.bridge.ReactApplicationContext; 5 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 6 | import com.facebook.react.bridge.ReactMethod; 7 | import com.facebook.react.bridge.ReadableMap; 8 | import com.facebook.react.bridge.Promise; 9 | import com.facebook.react.bridge.WritableMap; 10 | 11 | import java.io.File; 12 | import java.util.UUID; 13 | 14 | import android.util.Base64; 15 | import java.io.IOException; 16 | import java.io.RandomAccessFile; 17 | 18 | 19 | import android.os.Environment; 20 | import android.print.PdfConverter; 21 | 22 | public class RNHTMLtoPDFModule extends ReactContextBaseJavaModule { 23 | 24 | private final ReactApplicationContext mReactContext; 25 | 26 | public RNHTMLtoPDFModule(ReactApplicationContext reactContext) { 27 | super(reactContext); 28 | mReactContext = reactContext; 29 | } 30 | 31 | @Override 32 | public String getName() { 33 | return "RNHTMLtoPDF"; 34 | } 35 | 36 | @ReactMethod 37 | public void convert(final ReadableMap options, final Promise promise) { 38 | try { 39 | File destinationFile; 40 | String htmlString = options.hasKey("html") ? options.getString("html") : null; 41 | if (htmlString == null) return; 42 | 43 | String fileName; 44 | if (options.hasKey("fileName")) { 45 | fileName = options.getString("fileName"); 46 | } else { 47 | fileName = UUID.randomUUID().toString(); 48 | } 49 | 50 | if (options.hasKey("directory") && options.getString("directory").equals("docs")) { 51 | String state = Environment.getExternalStorageState(); 52 | File path = (Environment.MEDIA_MOUNTED.equals(state)) ? 53 | new File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DOCUMENTS) 54 | : new File(mReactContext.getFilesDir(), Environment.DIRECTORY_DOCUMENTS); 55 | 56 | if (!path.exists()) path.mkdir(); 57 | destinationFile = new File(path, fileName + ".pdf"); 58 | } else { 59 | destinationFile = getTempFile(fileName); 60 | } 61 | 62 | String filePath = convertToPDF(htmlString, destinationFile); 63 | String base64 = ""; 64 | 65 | if (options.hasKey("base64") && options.getBoolean("base64") == true) { 66 | base64 = encodeFromFile(destinationFile); 67 | } 68 | 69 | 70 | WritableMap resultMap = Arguments.createMap(); 71 | resultMap.putString("filePath", filePath); 72 | resultMap.putString("base64", base64); 73 | 74 | promise.resolve(resultMap); 75 | } catch (Exception e) { 76 | promise.reject(e.getMessage()); 77 | } 78 | } 79 | 80 | private String convertToPDF(String htmlString, File file) throws Exception { 81 | try { 82 | PdfConverter.getInstance() 83 | .convert(mReactContext, htmlString, file); 84 | String absolutePath = file.getAbsolutePath(); 85 | 86 | return absolutePath; 87 | } catch (Exception e) { 88 | throw new Exception(e); 89 | } 90 | } 91 | 92 | private File getTempFile(String fileName) throws Exception { 93 | try { 94 | File outputDir = getReactApplicationContext().getCacheDir(); 95 | File outputFile = File.createTempFile("PDF_" + UUID.randomUUID().toString(), ".pdf", outputDir); 96 | 97 | return outputFile; 98 | 99 | } catch (Exception e) { 100 | throw new Exception(e); 101 | } 102 | } 103 | 104 | private String encodeFromFile(File file) throws IOException{ 105 | RandomAccessFile randomAccessFile = new RandomAccessFile(file, "r"); 106 | byte[] fileBytes = new byte[(int)randomAccessFile.length()]; 107 | randomAccessFile.readFully(fileBytes); 108 | return Base64.encodeToString(fileBytes, Base64.DEFAULT); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /android/src/main/java/com/christopherdro/htmltopdf/RNHTMLtoPDFPackage.java: -------------------------------------------------------------------------------- 1 | package com.christopherdro.htmltopdf; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.JavaScriptModule; 5 | import com.facebook.react.bridge.NativeModule; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.react.uimanager.ViewManager; 8 | 9 | import java.util.ArrayList; 10 | import java.util.Collections; 11 | import java.util.List; 12 | 13 | public class RNHTMLtoPDFPackage implements ReactPackage { 14 | 15 | public List> createJSModules() { 16 | return Collections.emptyList(); 17 | } 18 | 19 | @Override 20 | public List createViewManagers(ReactApplicationContext reactContext) { 21 | return Collections.emptyList(); 22 | } 23 | 24 | @Override 25 | public List createNativeModules(ReactApplicationContext reactContext) { 26 | List modules = new ArrayList<>(); 27 | modules.add(new RNHTMLtoPDFModule(reactContext)); 28 | return modules; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /example/__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /example/__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /example/android/HTMLToPDF.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # To learn about Buck see [Docs](https://buckbuild.com/). 4 | # To run your application with Buck: 5 | # - install Buck 6 | # - `npm start` - to start the packager 7 | # - `cd android` 8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 10 | # - `buck install -r android/app` - compile, install and run application 11 | # 12 | 13 | lib_deps = [] 14 | for jarfile in glob(['libs/*.jar']): 15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) 16 | lib_deps.append(':' + name) 17 | prebuilt_jar( 18 | name = name, 19 | binary_jar = jarfile, 20 | ) 21 | 22 | for aarfile in glob(['libs/*.aar']): 23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) 24 | lib_deps.append(':' + name) 25 | android_prebuilt_aar( 26 | name = name, 27 | aar = aarfile, 28 | ) 29 | 30 | android_library( 31 | name = 'all-libs', 32 | exported_deps = lib_deps 33 | ) 34 | 35 | android_library( 36 | name = 'app-code', 37 | srcs = glob([ 38 | 'src/main/java/**/*.java', 39 | ]), 40 | deps = [ 41 | ':all-libs', 42 | ':build_config', 43 | ':res', 44 | ], 45 | ) 46 | 47 | android_build_config( 48 | name = 'build_config', 49 | package = 'com.htmltopdf', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.htmltopdf', 56 | ) 57 | 58 | android_binary( 59 | name = 'app', 60 | package_type = 'debug', 61 | manifest = 'src/main/AndroidManifest.xml', 62 | keystore = '//android/keystores:debug', 63 | deps = [ 64 | ':app-code', 65 | ], 66 | ) 67 | -------------------------------------------------------------------------------- /example/android/app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // the root of your project, i.e. where "package.json" lives 37 | * root: "../../", 38 | * 39 | * // where to put the JS bundle asset in debug mode 40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 41 | * 42 | * // where to put the JS bundle asset in release mode 43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 44 | * 45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 46 | * // require('./image.png')), in debug mode 47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 48 | * 49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 50 | * // require('./image.png')), in release mode 51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 52 | * 53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 57 | * // for example, you might want to remove it from here. 58 | * inputExcludes: ["android/**", "ios/**"], 59 | * 60 | * // override which node gets called and with what additional arguments 61 | * nodeExecutableAndArgs: ["node"] 62 | * 63 | * // supply additional arguments to the packager 64 | * extraPackagerArgs: [] 65 | * ] 66 | */ 67 | 68 | apply from: "../../node_modules/react-native/react.gradle" 69 | 70 | /** 71 | * Set this to true to create two separate APKs instead of one: 72 | * - An APK that only works on ARM devices 73 | * - An APK that only works on x86 devices 74 | * The advantage is the size of the APK is reduced by about 4MB. 75 | * Upload all the APKs to the Play Store and people will download 76 | * the correct one based on the CPU architecture of their device. 77 | */ 78 | def enableSeparateBuildPerCPUArchitecture = false 79 | 80 | /** 81 | * Run Proguard to shrink the Java bytecode in release builds. 82 | */ 83 | def enableProguardInReleaseBuilds = false 84 | 85 | android { 86 | compileSdkVersion 23 87 | buildToolsVersion "23.0.1" 88 | 89 | defaultConfig { 90 | applicationId "com.htmltopdf" 91 | minSdkVersion 16 92 | targetSdkVersion 22 93 | versionCode 1 94 | versionName "1.0" 95 | ndk { 96 | abiFilters "armeabi-v7a", "x86" 97 | } 98 | } 99 | splits { 100 | abi { 101 | reset() 102 | enable enableSeparateBuildPerCPUArchitecture 103 | universalApk false // If true, also generate a universal APK 104 | include "armeabi-v7a", "x86" 105 | } 106 | } 107 | buildTypes { 108 | release { 109 | minifyEnabled enableProguardInReleaseBuilds 110 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 111 | } 112 | } 113 | // applicationVariants are e.g. debug, release 114 | applicationVariants.all { variant -> 115 | variant.outputs.each { output -> 116 | // For each separate APK per architecture, set a unique version code as described here: 117 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 118 | def versionCodes = ["armeabi-v7a":1, "x86":2] 119 | def abi = output.getFilter(OutputFile.ABI) 120 | if (abi != null) { // null for the universal-debug, universal-release variants 121 | output.versionCodeOverride = 122 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 123 | } 124 | } 125 | } 126 | } 127 | 128 | dependencies { 129 | compile fileTree(dir: "libs", include: ["*.jar"]) 130 | compile "com.android.support:appcompat-v7:23.0.1" 131 | compile "com.facebook.react:react-native:+" // From node_modules 132 | compile project(':react-native-html-to-pdf') 133 | 134 | } 135 | 136 | // Run this once to be able to run the application with BUCK 137 | // puts all compile dependencies into folder libs for BUCK to use 138 | task copyDownloadableDepsToLibs(type: Copy) { 139 | from configurations.compile 140 | into 'libs' 141 | } 142 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # okhttp 54 | 55 | -keepattributes Signature 56 | -keepattributes *Annotation* 57 | -keep class okhttp3.** { *; } 58 | -keep interface okhttp3.** { *; } 59 | -dontwarn okhttp3.** 60 | 61 | # okio 62 | 63 | -keep class sun.misc.Unsafe { *; } 64 | -dontwarn java.nio.file.* 65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 66 | -dontwarn okio.** 67 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/htmltopdf/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.htmltopdf; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "HTMLToPDF"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/htmltopdf/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.htmltopdf; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.shell.MainReactPackage; 11 | import com.facebook.soloader.SoLoader; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | import com.christopherdro.htmltopdf.RNHTMLtoPDFPackage; 17 | 18 | 19 | public class MainApplication extends Application implements ReactApplication { 20 | 21 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 22 | @Override 23 | protected boolean getUseDeveloperSupport() { 24 | return BuildConfig.DEBUG; 25 | } 26 | 27 | @Override 28 | protected List getPackages() { 29 | return Arrays.asList( 30 | new MainReactPackage(), 31 | new RNHTMLtoPDFPackage() 32 | ); 33 | } 34 | }; 35 | 36 | @Override 37 | public ReactNativeHost getReactNativeHost() { 38 | return mReactNativeHost; 39 | } 40 | 41 | @Override 42 | public void onCreate() { 43 | super.onCreate(); 44 | SoLoader.init(this, /* native exopackage */ false); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blink22/react-native-html-to-pdf/f0a922f1830b9eb8545701e8cf99ad2d32053e7d/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blink22/react-native-html-to-pdf/f0a922f1830b9eb8545701e8cf99ad2d32053e7d/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blink22/react-native-html-to-pdf/f0a922f1830b9eb8545701e8cf99ad2d32053e7d/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blink22/react-native-html-to-pdf/f0a922f1830b9eb8545701e8cf99ad2d32053e7d/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | HTMLToPDF 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blink22/react-native-html-to-pdf/f0a922f1830b9eb8545701e8cf99ad2d32053e7d/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HTMLToPDF' 2 | 3 | include ':app' 4 | 5 | include ':react-native-html-to-pdf' 6 | project(':react-native-html-to-pdf').projectDir = new File(rootProject.projectDir,'../node_modules/react-native-html-to-pdf/android') 7 | -------------------------------------------------------------------------------- /example/index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | import RNHTMLtoPDF from 'react-native-html-to-pdf'; 16 | 17 | export default class HTMLToPDF extends Component { 18 | 19 | async componentDidMount() { 20 | let options = { 21 | html: '

Heading 1

Heading 2

Heading 3

', 22 | fileName: 'test', 23 | base64: true 24 | }; 25 | 26 | try { 27 | const results = await RNHTMLtoPDF.convert(options) 28 | console.log(results) 29 | } catch (err) { 30 | console.error(err) 31 | } 32 | } 33 | 34 | render() { 35 | return ( 36 | 37 | 38 | Welcome to React Native! 39 | 40 | 41 | To get started, edit index.ios.js 42 | 43 | 44 | Press Cmd+R to reload,{'\n'} 45 | Cmd+D or shake for dev menu 46 | 47 | 48 | ); 49 | } 50 | } 51 | 52 | const styles = StyleSheet.create({ 53 | container: { 54 | flex: 1, 55 | justifyContent: 'center', 56 | alignItems: 'center', 57 | backgroundColor: '#F5FCFF', 58 | }, 59 | welcome: { 60 | fontSize: 20, 61 | textAlign: 'center', 62 | margin: 10, 63 | }, 64 | instructions: { 65 | textAlign: 'center', 66 | color: '#333333', 67 | marginBottom: 5, 68 | }, 69 | }); 70 | 71 | AppRegistry.registerComponent('HTMLToPDF', () => HTMLToPDF); 72 | -------------------------------------------------------------------------------- /example/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | import RNHTMLtoPDF from 'react-native-html-to-pdf'; 16 | 17 | export default class HTMLToPDF extends Component { 18 | 19 | async componentDidMount() { 20 | let options = { 21 | html: '

Heading 1

Heading 2

Heading 3

', 22 | fileName: 'test', 23 | base64: true, 24 | }; 25 | 26 | try { 27 | const results = await RNHTMLtoPDF.convert(options) 28 | console.log(results) 29 | } catch (err) { 30 | console.error(err) 31 | } 32 | } 33 | 34 | render() { 35 | return ( 36 | 37 | 38 | Welcome to React Native! 39 | 40 | 41 | To get started, edit index.ios.js 42 | 43 | 44 | Press Cmd+R to reload,{'\n'} 45 | Cmd+D or shake for dev menu 46 | 47 | 48 | ); 49 | } 50 | } 51 | 52 | const styles = StyleSheet.create({ 53 | container: { 54 | flex: 1, 55 | justifyContent: 'center', 56 | alignItems: 'center', 57 | backgroundColor: '#F5FCFF', 58 | }, 59 | welcome: { 60 | fontSize: 20, 61 | textAlign: 'center', 62 | margin: 10, 63 | }, 64 | instructions: { 65 | textAlign: 'center', 66 | color: '#333333', 67 | marginBottom: 5, 68 | }, 69 | }); 70 | 71 | AppRegistry.registerComponent('HTMLToPDF', () => HTMLToPDF); 72 | -------------------------------------------------------------------------------- /example/ios/HTMLToPDF.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 11E184441E2C387F009991F2 /* libRNHTMLtoPDF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 11E184411E2C382E009991F2 /* libRNHTMLtoPDF.a */; }; 16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 23 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 25 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 26 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 33 | proxyType = 2; 34 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 35 | remoteInfo = RCTActionSheet; 36 | }; 37 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 40 | proxyType = 2; 41 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 42 | remoteInfo = RCTGeolocation; 43 | }; 44 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 47 | proxyType = 2; 48 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 49 | remoteInfo = RCTImage; 50 | }; 51 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 54 | proxyType = 2; 55 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 56 | remoteInfo = RCTNetwork; 57 | }; 58 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 59 | isa = PBXContainerItemProxy; 60 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 61 | proxyType = 2; 62 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 63 | remoteInfo = RCTVibration; 64 | }; 65 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 68 | proxyType = 1; 69 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 70 | remoteInfo = HTMLToPDF; 71 | }; 72 | 11E184401E2C382E009991F2 /* PBXContainerItemProxy */ = { 73 | isa = PBXContainerItemProxy; 74 | containerPortal = 11E1843B1E2C382E009991F2 /* RNHTMLtoPDF.xcodeproj */; 75 | proxyType = 2; 76 | remoteGlobalIDString = 117405EF1B9954BF004425E1; 77 | remoteInfo = RNHTMLtoPDF; 78 | }; 79 | 11E184421E2C382E009991F2 /* PBXContainerItemProxy */ = { 80 | isa = PBXContainerItemProxy; 81 | containerPortal = 11E1843B1E2C382E009991F2 /* RNHTMLtoPDF.xcodeproj */; 82 | proxyType = 2; 83 | remoteGlobalIDString = 117405FA1B9954BF004425E1; 84 | remoteInfo = RNHTMLtoPDFTests; 85 | }; 86 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 87 | isa = PBXContainerItemProxy; 88 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 89 | proxyType = 2; 90 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 91 | remoteInfo = RCTSettings; 92 | }; 93 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 94 | isa = PBXContainerItemProxy; 95 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 96 | proxyType = 2; 97 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 98 | remoteInfo = RCTWebSocket; 99 | }; 100 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 101 | isa = PBXContainerItemProxy; 102 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 103 | proxyType = 2; 104 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 105 | remoteInfo = React; 106 | }; 107 | 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = { 108 | isa = PBXContainerItemProxy; 109 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 110 | proxyType = 2; 111 | remoteGlobalIDString = 2D2A283A1D9B042B00D4039D; 112 | remoteInfo = "RCTImage-tvOS"; 113 | }; 114 | 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */ = { 115 | isa = PBXContainerItemProxy; 116 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 117 | proxyType = 2; 118 | remoteGlobalIDString = 2D2A28471D9B043800D4039D; 119 | remoteInfo = "RCTLinking-tvOS"; 120 | }; 121 | 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 122 | isa = PBXContainerItemProxy; 123 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 124 | proxyType = 2; 125 | remoteGlobalIDString = 2D2A28541D9B044C00D4039D; 126 | remoteInfo = "RCTNetwork-tvOS"; 127 | }; 128 | 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 129 | isa = PBXContainerItemProxy; 130 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 131 | proxyType = 2; 132 | remoteGlobalIDString = 2D2A28611D9B046600D4039D; 133 | remoteInfo = "RCTSettings-tvOS"; 134 | }; 135 | 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = { 136 | isa = PBXContainerItemProxy; 137 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 138 | proxyType = 2; 139 | remoteGlobalIDString = 2D2A287B1D9B048500D4039D; 140 | remoteInfo = "RCTText-tvOS"; 141 | }; 142 | 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */ = { 143 | isa = PBXContainerItemProxy; 144 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 145 | proxyType = 2; 146 | remoteGlobalIDString = 2D2A28881D9B049200D4039D; 147 | remoteInfo = "RCTWebSocket-tvOS"; 148 | }; 149 | 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */ = { 150 | isa = PBXContainerItemProxy; 151 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 152 | proxyType = 2; 153 | remoteGlobalIDString = 2D2A28131D9B038B00D4039D; 154 | remoteInfo = "React-tvOS"; 155 | }; 156 | 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */ = { 157 | isa = PBXContainerItemProxy; 158 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 159 | proxyType = 2; 160 | remoteGlobalIDString = 3D3C059A1DE3340900C268FA; 161 | remoteInfo = yoga; 162 | }; 163 | 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */ = { 164 | isa = PBXContainerItemProxy; 165 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 166 | proxyType = 2; 167 | remoteGlobalIDString = 3D3C06751DE3340C00C268FA; 168 | remoteInfo = "yoga-tvOS"; 169 | }; 170 | 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */ = { 171 | isa = PBXContainerItemProxy; 172 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 173 | proxyType = 2; 174 | remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4; 175 | remoteInfo = cxxreact; 176 | }; 177 | 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 178 | isa = PBXContainerItemProxy; 179 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 180 | proxyType = 2; 181 | remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4; 182 | remoteInfo = "cxxreact-tvOS"; 183 | }; 184 | 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 185 | isa = PBXContainerItemProxy; 186 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 187 | proxyType = 2; 188 | remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4; 189 | remoteInfo = jschelpers; 190 | }; 191 | 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 192 | isa = PBXContainerItemProxy; 193 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 194 | proxyType = 2; 195 | remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4; 196 | remoteInfo = "jschelpers-tvOS"; 197 | }; 198 | 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 199 | isa = PBXContainerItemProxy; 200 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 201 | proxyType = 2; 202 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 203 | remoteInfo = RCTAnimation; 204 | }; 205 | 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 206 | isa = PBXContainerItemProxy; 207 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 208 | proxyType = 2; 209 | remoteGlobalIDString = 2D2A28201D9B03D100D4039D; 210 | remoteInfo = "RCTAnimation-tvOS"; 211 | }; 212 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 213 | isa = PBXContainerItemProxy; 214 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 215 | proxyType = 2; 216 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 217 | remoteInfo = RCTLinking; 218 | }; 219 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 220 | isa = PBXContainerItemProxy; 221 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 222 | proxyType = 2; 223 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 224 | remoteInfo = RCTText; 225 | }; 226 | /* End PBXContainerItemProxy section */ 227 | 228 | /* Begin PBXFileReference section */ 229 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 230 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 231 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 232 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 233 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 234 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 235 | 00E356EE1AD99517003FC87E /* HTMLToPDFTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HTMLToPDFTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 236 | 11E1843B1E2C382E009991F2 /* RNHTMLtoPDF.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNHTMLtoPDF.xcodeproj; path = "../node_modules/react-native-html-to-pdf/ios/RNHTMLtoPDF.xcodeproj"; sourceTree = ""; }; 237 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 238 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 239 | 13B07F961A680F5B00A75B9A /* HTMLToPDF.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HTMLToPDF.app; sourceTree = BUILT_PRODUCTS_DIR; }; 240 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = HTMLToPDF/AppDelegate.h; sourceTree = ""; }; 241 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = HTMLToPDF/AppDelegate.m; sourceTree = ""; }; 242 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 243 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HTMLToPDF/Images.xcassets; sourceTree = ""; }; 244 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HTMLToPDF/Info.plist; sourceTree = ""; }; 245 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HTMLToPDF/main.m; sourceTree = ""; }; 246 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 247 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 248 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 249 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 250 | /* End PBXFileReference section */ 251 | 252 | /* Begin PBXFrameworksBuildPhase section */ 253 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 254 | isa = PBXFrameworksBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 262 | isa = PBXFrameworksBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | 11E184441E2C387F009991F2 /* libRNHTMLtoPDF.a in Frameworks */, 266 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 267 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 268 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 269 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 270 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 271 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 272 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 273 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 274 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 275 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 276 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | /* End PBXFrameworksBuildPhase section */ 281 | 282 | /* Begin PBXGroup section */ 283 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 284 | isa = PBXGroup; 285 | children = ( 286 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 287 | ); 288 | name = Products; 289 | sourceTree = ""; 290 | }; 291 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 292 | isa = PBXGroup; 293 | children = ( 294 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 295 | ); 296 | name = Products; 297 | sourceTree = ""; 298 | }; 299 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 300 | isa = PBXGroup; 301 | children = ( 302 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 303 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */, 304 | ); 305 | name = Products; 306 | sourceTree = ""; 307 | }; 308 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 309 | isa = PBXGroup; 310 | children = ( 311 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 312 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */, 313 | ); 314 | name = Products; 315 | sourceTree = ""; 316 | }; 317 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 318 | isa = PBXGroup; 319 | children = ( 320 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 321 | ); 322 | name = Products; 323 | sourceTree = ""; 324 | }; 325 | 11E1843C1E2C382E009991F2 /* Products */ = { 326 | isa = PBXGroup; 327 | children = ( 328 | 11E184411E2C382E009991F2 /* libRNHTMLtoPDF.a */, 329 | 11E184431E2C382E009991F2 /* RNHTMLtoPDFTests.xctest */, 330 | ); 331 | name = Products; 332 | sourceTree = ""; 333 | }; 334 | 139105B71AF99BAD00B5F7CC /* Products */ = { 335 | isa = PBXGroup; 336 | children = ( 337 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 338 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */, 339 | ); 340 | name = Products; 341 | sourceTree = ""; 342 | }; 343 | 139FDEE71B06529A00C62182 /* Products */ = { 344 | isa = PBXGroup; 345 | children = ( 346 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 347 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */, 348 | ); 349 | name = Products; 350 | sourceTree = ""; 351 | }; 352 | 13B07FAE1A68108700A75B9A /* HTMLToPDF */ = { 353 | isa = PBXGroup; 354 | children = ( 355 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 356 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 357 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 358 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 359 | 13B07FB61A68108700A75B9A /* Info.plist */, 360 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 361 | 13B07FB71A68108700A75B9A /* main.m */, 362 | ); 363 | name = HTMLToPDF; 364 | sourceTree = ""; 365 | }; 366 | 146834001AC3E56700842450 /* Products */ = { 367 | isa = PBXGroup; 368 | children = ( 369 | 146834041AC3E56700842450 /* libReact.a */, 370 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */, 371 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */, 372 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */, 373 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */, 374 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */, 375 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */, 376 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */, 377 | ); 378 | name = Products; 379 | sourceTree = ""; 380 | }; 381 | 5E91572E1DD0AC6500FF2AA8 /* Products */ = { 382 | isa = PBXGroup; 383 | children = ( 384 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */, 385 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */, 386 | ); 387 | name = Products; 388 | sourceTree = ""; 389 | }; 390 | 78C398B11ACF4ADC00677621 /* Products */ = { 391 | isa = PBXGroup; 392 | children = ( 393 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 394 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */, 395 | ); 396 | name = Products; 397 | sourceTree = ""; 398 | }; 399 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 400 | isa = PBXGroup; 401 | children = ( 402 | 11E1843B1E2C382E009991F2 /* RNHTMLtoPDF.xcodeproj */, 403 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 404 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 405 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 406 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 407 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 408 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 409 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 410 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 411 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 412 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 413 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 414 | ); 415 | name = Libraries; 416 | sourceTree = ""; 417 | }; 418 | 832341B11AAA6A8300B99B32 /* Products */ = { 419 | isa = PBXGroup; 420 | children = ( 421 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 422 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */, 423 | ); 424 | name = Products; 425 | sourceTree = ""; 426 | }; 427 | 83CBB9F61A601CBA00E9B192 = { 428 | isa = PBXGroup; 429 | children = ( 430 | 13B07FAE1A68108700A75B9A /* HTMLToPDF */, 431 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 432 | 83CBBA001A601CBA00E9B192 /* Products */, 433 | ); 434 | indentWidth = 2; 435 | sourceTree = ""; 436 | tabWidth = 2; 437 | }; 438 | 83CBBA001A601CBA00E9B192 /* Products */ = { 439 | isa = PBXGroup; 440 | children = ( 441 | 13B07F961A680F5B00A75B9A /* HTMLToPDF.app */, 442 | 00E356EE1AD99517003FC87E /* HTMLToPDFTests.xctest */, 443 | ); 444 | name = Products; 445 | sourceTree = ""; 446 | }; 447 | /* End PBXGroup section */ 448 | 449 | /* Begin PBXNativeTarget section */ 450 | 00E356ED1AD99517003FC87E /* HTMLToPDFTests */ = { 451 | isa = PBXNativeTarget; 452 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "HTMLToPDFTests" */; 453 | buildPhases = ( 454 | 00E356EA1AD99517003FC87E /* Sources */, 455 | 00E356EB1AD99517003FC87E /* Frameworks */, 456 | 00E356EC1AD99517003FC87E /* Resources */, 457 | ); 458 | buildRules = ( 459 | ); 460 | dependencies = ( 461 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 462 | ); 463 | name = HTMLToPDFTests; 464 | productName = HTMLToPDFTests; 465 | productReference = 00E356EE1AD99517003FC87E /* HTMLToPDFTests.xctest */; 466 | productType = "com.apple.product-type.bundle.unit-test"; 467 | }; 468 | 13B07F861A680F5B00A75B9A /* HTMLToPDF */ = { 469 | isa = PBXNativeTarget; 470 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HTMLToPDF" */; 471 | buildPhases = ( 472 | 13B07F871A680F5B00A75B9A /* Sources */, 473 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 474 | 13B07F8E1A680F5B00A75B9A /* Resources */, 475 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 476 | ); 477 | buildRules = ( 478 | ); 479 | dependencies = ( 480 | ); 481 | name = HTMLToPDF; 482 | productName = "Hello World"; 483 | productReference = 13B07F961A680F5B00A75B9A /* HTMLToPDF.app */; 484 | productType = "com.apple.product-type.application"; 485 | }; 486 | /* End PBXNativeTarget section */ 487 | 488 | /* Begin PBXProject section */ 489 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 490 | isa = PBXProject; 491 | attributes = { 492 | LastUpgradeCheck = 0820; 493 | ORGANIZATIONNAME = Facebook; 494 | TargetAttributes = { 495 | 00E356ED1AD99517003FC87E = { 496 | CreatedOnToolsVersion = 6.2; 497 | TestTargetID = 13B07F861A680F5B00A75B9A; 498 | }; 499 | 13B07F861A680F5B00A75B9A = { 500 | ProvisioningStyle = Manual; 501 | }; 502 | }; 503 | }; 504 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HTMLToPDF" */; 505 | compatibilityVersion = "Xcode 3.2"; 506 | developmentRegion = English; 507 | hasScannedForEncodings = 0; 508 | knownRegions = ( 509 | en, 510 | Base, 511 | ); 512 | mainGroup = 83CBB9F61A601CBA00E9B192; 513 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 514 | projectDirPath = ""; 515 | projectReferences = ( 516 | { 517 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 518 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 519 | }, 520 | { 521 | ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */; 522 | ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 523 | }, 524 | { 525 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 526 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 527 | }, 528 | { 529 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 530 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 531 | }, 532 | { 533 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 534 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 535 | }, 536 | { 537 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 538 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 539 | }, 540 | { 541 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 542 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 543 | }, 544 | { 545 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 546 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 547 | }, 548 | { 549 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 550 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 551 | }, 552 | { 553 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 554 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 555 | }, 556 | { 557 | ProductGroup = 146834001AC3E56700842450 /* Products */; 558 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 559 | }, 560 | { 561 | ProductGroup = 11E1843C1E2C382E009991F2 /* Products */; 562 | ProjectRef = 11E1843B1E2C382E009991F2 /* RNHTMLtoPDF.xcodeproj */; 563 | }, 564 | ); 565 | projectRoot = ""; 566 | targets = ( 567 | 13B07F861A680F5B00A75B9A /* HTMLToPDF */, 568 | 00E356ED1AD99517003FC87E /* HTMLToPDFTests */, 569 | ); 570 | }; 571 | /* End PBXProject section */ 572 | 573 | /* Begin PBXReferenceProxy section */ 574 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 575 | isa = PBXReferenceProxy; 576 | fileType = archive.ar; 577 | path = libRCTActionSheet.a; 578 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 579 | sourceTree = BUILT_PRODUCTS_DIR; 580 | }; 581 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 582 | isa = PBXReferenceProxy; 583 | fileType = archive.ar; 584 | path = libRCTGeolocation.a; 585 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 586 | sourceTree = BUILT_PRODUCTS_DIR; 587 | }; 588 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 589 | isa = PBXReferenceProxy; 590 | fileType = archive.ar; 591 | path = libRCTImage.a; 592 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 593 | sourceTree = BUILT_PRODUCTS_DIR; 594 | }; 595 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 596 | isa = PBXReferenceProxy; 597 | fileType = archive.ar; 598 | path = libRCTNetwork.a; 599 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 600 | sourceTree = BUILT_PRODUCTS_DIR; 601 | }; 602 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 603 | isa = PBXReferenceProxy; 604 | fileType = archive.ar; 605 | path = libRCTVibration.a; 606 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 607 | sourceTree = BUILT_PRODUCTS_DIR; 608 | }; 609 | 11E184411E2C382E009991F2 /* libRNHTMLtoPDF.a */ = { 610 | isa = PBXReferenceProxy; 611 | fileType = archive.ar; 612 | path = libRNHTMLtoPDF.a; 613 | remoteRef = 11E184401E2C382E009991F2 /* PBXContainerItemProxy */; 614 | sourceTree = BUILT_PRODUCTS_DIR; 615 | }; 616 | 11E184431E2C382E009991F2 /* RNHTMLtoPDFTests.xctest */ = { 617 | isa = PBXReferenceProxy; 618 | fileType = wrapper.cfbundle; 619 | path = RNHTMLtoPDFTests.xctest; 620 | remoteRef = 11E184421E2C382E009991F2 /* PBXContainerItemProxy */; 621 | sourceTree = BUILT_PRODUCTS_DIR; 622 | }; 623 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 624 | isa = PBXReferenceProxy; 625 | fileType = archive.ar; 626 | path = libRCTSettings.a; 627 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 628 | sourceTree = BUILT_PRODUCTS_DIR; 629 | }; 630 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 631 | isa = PBXReferenceProxy; 632 | fileType = archive.ar; 633 | path = libRCTWebSocket.a; 634 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 635 | sourceTree = BUILT_PRODUCTS_DIR; 636 | }; 637 | 146834041AC3E56700842450 /* libReact.a */ = { 638 | isa = PBXReferenceProxy; 639 | fileType = archive.ar; 640 | path = libReact.a; 641 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 642 | sourceTree = BUILT_PRODUCTS_DIR; 643 | }; 644 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = { 645 | isa = PBXReferenceProxy; 646 | fileType = archive.ar; 647 | path = "libRCTImage-tvOS.a"; 648 | remoteRef = 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */; 649 | sourceTree = BUILT_PRODUCTS_DIR; 650 | }; 651 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */ = { 652 | isa = PBXReferenceProxy; 653 | fileType = archive.ar; 654 | path = "libRCTLinking-tvOS.a"; 655 | remoteRef = 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */; 656 | sourceTree = BUILT_PRODUCTS_DIR; 657 | }; 658 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */ = { 659 | isa = PBXReferenceProxy; 660 | fileType = archive.ar; 661 | path = "libRCTNetwork-tvOS.a"; 662 | remoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */; 663 | sourceTree = BUILT_PRODUCTS_DIR; 664 | }; 665 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */ = { 666 | isa = PBXReferenceProxy; 667 | fileType = archive.ar; 668 | path = "libRCTSettings-tvOS.a"; 669 | remoteRef = 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */; 670 | sourceTree = BUILT_PRODUCTS_DIR; 671 | }; 672 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = { 673 | isa = PBXReferenceProxy; 674 | fileType = archive.ar; 675 | path = "libRCTText-tvOS.a"; 676 | remoteRef = 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */; 677 | sourceTree = BUILT_PRODUCTS_DIR; 678 | }; 679 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */ = { 680 | isa = PBXReferenceProxy; 681 | fileType = archive.ar; 682 | path = "libRCTWebSocket-tvOS.a"; 683 | remoteRef = 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */; 684 | sourceTree = BUILT_PRODUCTS_DIR; 685 | }; 686 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */ = { 687 | isa = PBXReferenceProxy; 688 | fileType = archive.ar; 689 | path = libReact.a; 690 | remoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */; 691 | sourceTree = BUILT_PRODUCTS_DIR; 692 | }; 693 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */ = { 694 | isa = PBXReferenceProxy; 695 | fileType = archive.ar; 696 | path = libyoga.a; 697 | remoteRef = 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */; 698 | sourceTree = BUILT_PRODUCTS_DIR; 699 | }; 700 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */ = { 701 | isa = PBXReferenceProxy; 702 | fileType = archive.ar; 703 | path = libyoga.a; 704 | remoteRef = 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */; 705 | sourceTree = BUILT_PRODUCTS_DIR; 706 | }; 707 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */ = { 708 | isa = PBXReferenceProxy; 709 | fileType = archive.ar; 710 | path = libcxxreact.a; 711 | remoteRef = 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */; 712 | sourceTree = BUILT_PRODUCTS_DIR; 713 | }; 714 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */ = { 715 | isa = PBXReferenceProxy; 716 | fileType = archive.ar; 717 | path = libcxxreact.a; 718 | remoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */; 719 | sourceTree = BUILT_PRODUCTS_DIR; 720 | }; 721 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = { 722 | isa = PBXReferenceProxy; 723 | fileType = archive.ar; 724 | path = libjschelpers.a; 725 | remoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */; 726 | sourceTree = BUILT_PRODUCTS_DIR; 727 | }; 728 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = { 729 | isa = PBXReferenceProxy; 730 | fileType = archive.ar; 731 | path = libjschelpers.a; 732 | remoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */; 733 | sourceTree = BUILT_PRODUCTS_DIR; 734 | }; 735 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 736 | isa = PBXReferenceProxy; 737 | fileType = archive.ar; 738 | path = libRCTAnimation.a; 739 | remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 740 | sourceTree = BUILT_PRODUCTS_DIR; 741 | }; 742 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = { 743 | isa = PBXReferenceProxy; 744 | fileType = archive.ar; 745 | path = "libRCTAnimation-tvOS.a"; 746 | remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 747 | sourceTree = BUILT_PRODUCTS_DIR; 748 | }; 749 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 750 | isa = PBXReferenceProxy; 751 | fileType = archive.ar; 752 | path = libRCTLinking.a; 753 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 754 | sourceTree = BUILT_PRODUCTS_DIR; 755 | }; 756 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 757 | isa = PBXReferenceProxy; 758 | fileType = archive.ar; 759 | path = libRCTText.a; 760 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 761 | sourceTree = BUILT_PRODUCTS_DIR; 762 | }; 763 | /* End PBXReferenceProxy section */ 764 | 765 | /* Begin PBXResourcesBuildPhase section */ 766 | 00E356EC1AD99517003FC87E /* Resources */ = { 767 | isa = PBXResourcesBuildPhase; 768 | buildActionMask = 2147483647; 769 | files = ( 770 | ); 771 | runOnlyForDeploymentPostprocessing = 0; 772 | }; 773 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 774 | isa = PBXResourcesBuildPhase; 775 | buildActionMask = 2147483647; 776 | files = ( 777 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 778 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 779 | ); 780 | runOnlyForDeploymentPostprocessing = 0; 781 | }; 782 | /* End PBXResourcesBuildPhase section */ 783 | 784 | /* Begin PBXShellScriptBuildPhase section */ 785 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 786 | isa = PBXShellScriptBuildPhase; 787 | buildActionMask = 2147483647; 788 | files = ( 789 | ); 790 | inputPaths = ( 791 | ); 792 | name = "Bundle React Native code and images"; 793 | outputPaths = ( 794 | ); 795 | runOnlyForDeploymentPostprocessing = 0; 796 | shellPath = /bin/sh; 797 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 798 | }; 799 | /* End PBXShellScriptBuildPhase section */ 800 | 801 | /* Begin PBXSourcesBuildPhase section */ 802 | 00E356EA1AD99517003FC87E /* Sources */ = { 803 | isa = PBXSourcesBuildPhase; 804 | buildActionMask = 2147483647; 805 | files = ( 806 | ); 807 | runOnlyForDeploymentPostprocessing = 0; 808 | }; 809 | 13B07F871A680F5B00A75B9A /* Sources */ = { 810 | isa = PBXSourcesBuildPhase; 811 | buildActionMask = 2147483647; 812 | files = ( 813 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 814 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 815 | ); 816 | runOnlyForDeploymentPostprocessing = 0; 817 | }; 818 | /* End PBXSourcesBuildPhase section */ 819 | 820 | /* Begin PBXTargetDependency section */ 821 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 822 | isa = PBXTargetDependency; 823 | target = 13B07F861A680F5B00A75B9A /* HTMLToPDF */; 824 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 825 | }; 826 | /* End PBXTargetDependency section */ 827 | 828 | /* Begin PBXVariantGroup section */ 829 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 830 | isa = PBXVariantGroup; 831 | children = ( 832 | 13B07FB21A68108700A75B9A /* Base */, 833 | ); 834 | name = LaunchScreen.xib; 835 | path = HTMLToPDF; 836 | sourceTree = ""; 837 | }; 838 | /* End PBXVariantGroup section */ 839 | 840 | /* Begin XCBuildConfiguration section */ 841 | 00E356F61AD99517003FC87E /* Debug */ = { 842 | isa = XCBuildConfiguration; 843 | buildSettings = { 844 | BUNDLE_LOADER = "$(TEST_HOST)"; 845 | GCC_PREPROCESSOR_DEFINITIONS = ( 846 | "DEBUG=1", 847 | "$(inherited)", 848 | ); 849 | INFOPLIST_FILE = HTMLToPDFTests/Info.plist; 850 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 851 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 852 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 853 | PRODUCT_NAME = "$(TARGET_NAME)"; 854 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HTMLToPDF.app/HTMLToPDF"; 855 | }; 856 | name = Debug; 857 | }; 858 | 00E356F71AD99517003FC87E /* Release */ = { 859 | isa = XCBuildConfiguration; 860 | buildSettings = { 861 | BUNDLE_LOADER = "$(TEST_HOST)"; 862 | COPY_PHASE_STRIP = NO; 863 | INFOPLIST_FILE = HTMLToPDFTests/Info.plist; 864 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 865 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 866 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 867 | PRODUCT_NAME = "$(TARGET_NAME)"; 868 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HTMLToPDF.app/HTMLToPDF"; 869 | }; 870 | name = Release; 871 | }; 872 | 13B07F941A680F5B00A75B9A /* Debug */ = { 873 | isa = XCBuildConfiguration; 874 | buildSettings = { 875 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 876 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 877 | CURRENT_PROJECT_VERSION = 1; 878 | DEAD_CODE_STRIPPING = NO; 879 | DEVELOPMENT_TEAM = ""; 880 | INFOPLIST_FILE = HTMLToPDF/Info.plist; 881 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 882 | OTHER_LDFLAGS = ( 883 | "$(inherited)", 884 | "-ObjC", 885 | "-lc++", 886 | ); 887 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 888 | PRODUCT_NAME = HTMLToPDF; 889 | VERSIONING_SYSTEM = "apple-generic"; 890 | }; 891 | name = Debug; 892 | }; 893 | 13B07F951A680F5B00A75B9A /* Release */ = { 894 | isa = XCBuildConfiguration; 895 | buildSettings = { 896 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 897 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 898 | CURRENT_PROJECT_VERSION = 1; 899 | DEVELOPMENT_TEAM = ""; 900 | INFOPLIST_FILE = HTMLToPDF/Info.plist; 901 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 902 | OTHER_LDFLAGS = ( 903 | "$(inherited)", 904 | "-ObjC", 905 | "-lc++", 906 | ); 907 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 908 | PRODUCT_NAME = HTMLToPDF; 909 | VERSIONING_SYSTEM = "apple-generic"; 910 | }; 911 | name = Release; 912 | }; 913 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 914 | isa = XCBuildConfiguration; 915 | buildSettings = { 916 | ALWAYS_SEARCH_USER_PATHS = NO; 917 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 918 | CLANG_CXX_LIBRARY = "libc++"; 919 | CLANG_ENABLE_MODULES = YES; 920 | CLANG_ENABLE_OBJC_ARC = YES; 921 | CLANG_WARN_BOOL_CONVERSION = YES; 922 | CLANG_WARN_CONSTANT_CONVERSION = YES; 923 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 924 | CLANG_WARN_EMPTY_BODY = YES; 925 | CLANG_WARN_ENUM_CONVERSION = YES; 926 | CLANG_WARN_INFINITE_RECURSION = YES; 927 | CLANG_WARN_INT_CONVERSION = YES; 928 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 929 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 930 | CLANG_WARN_UNREACHABLE_CODE = YES; 931 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 932 | CODE_SIGN_IDENTITY = "iPhone Developer: Christopher Asheghian (YWU7975V7S)"; 933 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 934 | COPY_PHASE_STRIP = NO; 935 | ENABLE_STRICT_OBJC_MSGSEND = YES; 936 | ENABLE_TESTABILITY = YES; 937 | GCC_C_LANGUAGE_STANDARD = gnu99; 938 | GCC_DYNAMIC_NO_PIC = NO; 939 | GCC_NO_COMMON_BLOCKS = YES; 940 | GCC_OPTIMIZATION_LEVEL = 0; 941 | GCC_PREPROCESSOR_DEFINITIONS = ( 942 | "DEBUG=1", 943 | "$(inherited)", 944 | ); 945 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 946 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 947 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 948 | GCC_WARN_UNDECLARED_SELECTOR = YES; 949 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 950 | GCC_WARN_UNUSED_FUNCTION = YES; 951 | GCC_WARN_UNUSED_VARIABLE = YES; 952 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 953 | MTL_ENABLE_DEBUG_INFO = YES; 954 | ONLY_ACTIVE_ARCH = YES; 955 | SDKROOT = iphoneos; 956 | }; 957 | name = Debug; 958 | }; 959 | 83CBBA211A601CBA00E9B192 /* Release */ = { 960 | isa = XCBuildConfiguration; 961 | buildSettings = { 962 | ALWAYS_SEARCH_USER_PATHS = NO; 963 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 964 | CLANG_CXX_LIBRARY = "libc++"; 965 | CLANG_ENABLE_MODULES = YES; 966 | CLANG_ENABLE_OBJC_ARC = YES; 967 | CLANG_WARN_BOOL_CONVERSION = YES; 968 | CLANG_WARN_CONSTANT_CONVERSION = YES; 969 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 970 | CLANG_WARN_EMPTY_BODY = YES; 971 | CLANG_WARN_ENUM_CONVERSION = YES; 972 | CLANG_WARN_INFINITE_RECURSION = YES; 973 | CLANG_WARN_INT_CONVERSION = YES; 974 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 975 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 976 | CLANG_WARN_UNREACHABLE_CODE = YES; 977 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 978 | CODE_SIGN_IDENTITY = "iPhone Developer: Christopher Asheghian (YWU7975V7S)"; 979 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 980 | COPY_PHASE_STRIP = YES; 981 | ENABLE_NS_ASSERTIONS = NO; 982 | ENABLE_STRICT_OBJC_MSGSEND = YES; 983 | GCC_C_LANGUAGE_STANDARD = gnu99; 984 | GCC_NO_COMMON_BLOCKS = YES; 985 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 986 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 987 | GCC_WARN_UNDECLARED_SELECTOR = YES; 988 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 989 | GCC_WARN_UNUSED_FUNCTION = YES; 990 | GCC_WARN_UNUSED_VARIABLE = YES; 991 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 992 | MTL_ENABLE_DEBUG_INFO = NO; 993 | SDKROOT = iphoneos; 994 | VALIDATE_PRODUCT = YES; 995 | }; 996 | name = Release; 997 | }; 998 | /* End XCBuildConfiguration section */ 999 | 1000 | /* Begin XCConfigurationList section */ 1001 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "HTMLToPDFTests" */ = { 1002 | isa = XCConfigurationList; 1003 | buildConfigurations = ( 1004 | 00E356F61AD99517003FC87E /* Debug */, 1005 | 00E356F71AD99517003FC87E /* Release */, 1006 | ); 1007 | defaultConfigurationIsVisible = 0; 1008 | defaultConfigurationName = Release; 1009 | }; 1010 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HTMLToPDF" */ = { 1011 | isa = XCConfigurationList; 1012 | buildConfigurations = ( 1013 | 13B07F941A680F5B00A75B9A /* Debug */, 1014 | 13B07F951A680F5B00A75B9A /* Release */, 1015 | ); 1016 | defaultConfigurationIsVisible = 0; 1017 | defaultConfigurationName = Release; 1018 | }; 1019 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HTMLToPDF" */ = { 1020 | isa = XCConfigurationList; 1021 | buildConfigurations = ( 1022 | 83CBBA201A601CBA00E9B192 /* Debug */, 1023 | 83CBBA211A601CBA00E9B192 /* Release */, 1024 | ); 1025 | defaultConfigurationIsVisible = 0; 1026 | defaultConfigurationName = Release; 1027 | }; 1028 | /* End XCConfigurationList section */ 1029 | }; 1030 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 1031 | } 1032 | -------------------------------------------------------------------------------- /example/ios/HTMLToPDF.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/HTMLToPDF.xcodeproj/xcshareddata/xcschemes/HTMLToPDF.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/HTMLToPDF/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /example/ios/HTMLToPDF/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"HTMLToPDF" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /example/ios/HTMLToPDF/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ios/HTMLToPDF/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/HTMLToPDF/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSExceptionDomains 28 | 29 | localhost 30 | 31 | NSExceptionAllowsInsecureHTTPLoads 32 | 33 | 34 | 35 | 36 | NSLocationWhenInUseUsageDescription 37 | 38 | UILaunchStoryboardName 39 | LaunchScreen 40 | UIRequiredDeviceCapabilities 41 | 42 | armv7 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /example/ios/HTMLToPDF/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/ios/HTMLToPDFTests/HTMLToPDFTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface HTMLToPDFTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation HTMLToPDFTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /example/ios/HTMLToPDFTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "HTMLToPDF", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "react": "~15.4.0-rc.4", 11 | "react-native": "0.40.0", 12 | "react-native-html-to-pdf": "0.4.0" 13 | }, 14 | "devDependencies": { 15 | "babel-jest": "18.0.0", 16 | "babel-preset-react-native": "1.9.1", 17 | "jest": "18.1.0", 18 | "react-test-renderer": "~15.4.0-rc.4" 19 | }, 20 | "jest": { 21 | "preset": "react-native" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules } from 'react-native'; 2 | 3 | export default NativeModules.RNHTMLtoPDF; 4 | -------------------------------------------------------------------------------- /ios/RNHTMLtoPDF.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 117405F31B9954BF004425E1 /* RNHTMLtoPDF.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 117405F21B9954BF004425E1 /* RNHTMLtoPDF.h */; }; 11 | 117405F51B9954BF004425E1 /* RNHTMLtoPDF.m in Sources */ = {isa = PBXBuildFile; fileRef = 117405F41B9954BF004425E1 /* RNHTMLtoPDF.m */; }; 12 | 117405FB1B9954BF004425E1 /* libRNHTMLtoPDF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 117405EF1B9954BF004425E1 /* libRNHTMLtoPDF.a */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXContainerItemProxy section */ 16 | 117405FC1B9954BF004425E1 /* PBXContainerItemProxy */ = { 17 | isa = PBXContainerItemProxy; 18 | containerPortal = 117405E71B9954BF004425E1 /* Project object */; 19 | proxyType = 1; 20 | remoteGlobalIDString = 117405EE1B9954BF004425E1; 21 | remoteInfo = RNHTMLtoPDF; 22 | }; 23 | /* End PBXContainerItemProxy section */ 24 | 25 | /* Begin PBXCopyFilesBuildPhase section */ 26 | 117405ED1B9954BF004425E1 /* CopyFiles */ = { 27 | isa = PBXCopyFilesBuildPhase; 28 | buildActionMask = 2147483647; 29 | dstPath = "include/$(PRODUCT_NAME)"; 30 | dstSubfolderSpec = 16; 31 | files = ( 32 | 117405F31B9954BF004425E1 /* RNHTMLtoPDF.h in CopyFiles */, 33 | ); 34 | runOnlyForDeploymentPostprocessing = 0; 35 | }; 36 | /* End PBXCopyFilesBuildPhase section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 117405EF1B9954BF004425E1 /* libRNHTMLtoPDF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNHTMLtoPDF.a; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 117405F21B9954BF004425E1 /* RNHTMLtoPDF.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNHTMLtoPDF.h; sourceTree = ""; }; 41 | 117405F41B9954BF004425E1 /* RNHTMLtoPDF.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNHTMLtoPDF.m; sourceTree = ""; }; 42 | 117405FA1B9954BF004425E1 /* RNHTMLtoPDFTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNHTMLtoPDFTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 117406001B9954BF004425E1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | /* End PBXFileReference section */ 45 | 46 | /* Begin PBXFrameworksBuildPhase section */ 47 | 117405EC1B9954BF004425E1 /* Frameworks */ = { 48 | isa = PBXFrameworksBuildPhase; 49 | buildActionMask = 2147483647; 50 | files = ( 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | 117405F71B9954BF004425E1 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | 117405FB1B9954BF004425E1 /* libRNHTMLtoPDF.a in Frameworks */, 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXFrameworksBuildPhase section */ 63 | 64 | /* Begin PBXGroup section */ 65 | 117405E61B9954BF004425E1 = { 66 | isa = PBXGroup; 67 | children = ( 68 | 117405F11B9954BF004425E1 /* RNHTMLtoPDF */, 69 | 117405FE1B9954BF004425E1 /* RNHTMLtoPDFTests */, 70 | 117405F01B9954BF004425E1 /* Products */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | 117405F01B9954BF004425E1 /* Products */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 117405EF1B9954BF004425E1 /* libRNHTMLtoPDF.a */, 78 | 117405FA1B9954BF004425E1 /* RNHTMLtoPDFTests.xctest */, 79 | ); 80 | name = Products; 81 | sourceTree = ""; 82 | }; 83 | 117405F11B9954BF004425E1 /* RNHTMLtoPDF */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 117405F21B9954BF004425E1 /* RNHTMLtoPDF.h */, 87 | 117405F41B9954BF004425E1 /* RNHTMLtoPDF.m */, 88 | ); 89 | path = RNHTMLtoPDF; 90 | sourceTree = ""; 91 | }; 92 | 117405FE1B9954BF004425E1 /* RNHTMLtoPDFTests */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 117405FF1B9954BF004425E1 /* Supporting Files */, 96 | ); 97 | path = RNHTMLtoPDFTests; 98 | sourceTree = ""; 99 | }; 100 | 117405FF1B9954BF004425E1 /* Supporting Files */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 117406001B9954BF004425E1 /* Info.plist */, 104 | ); 105 | name = "Supporting Files"; 106 | sourceTree = ""; 107 | }; 108 | /* End PBXGroup section */ 109 | 110 | /* Begin PBXNativeTarget section */ 111 | 117405EE1B9954BF004425E1 /* RNHTMLtoPDF */ = { 112 | isa = PBXNativeTarget; 113 | buildConfigurationList = 117406031B9954BF004425E1 /* Build configuration list for PBXNativeTarget "RNHTMLtoPDF" */; 114 | buildPhases = ( 115 | 117405EB1B9954BF004425E1 /* Sources */, 116 | 117405EC1B9954BF004425E1 /* Frameworks */, 117 | 117405ED1B9954BF004425E1 /* CopyFiles */, 118 | ); 119 | buildRules = ( 120 | ); 121 | dependencies = ( 122 | ); 123 | name = RNHTMLtoPDF; 124 | productName = RNHTMLtoPDF; 125 | productReference = 117405EF1B9954BF004425E1 /* libRNHTMLtoPDF.a */; 126 | productType = "com.apple.product-type.library.static"; 127 | }; 128 | 117405F91B9954BF004425E1 /* RNHTMLtoPDFTests */ = { 129 | isa = PBXNativeTarget; 130 | buildConfigurationList = 117406061B9954BF004425E1 /* Build configuration list for PBXNativeTarget "RNHTMLtoPDFTests" */; 131 | buildPhases = ( 132 | 117405F61B9954BF004425E1 /* Sources */, 133 | 117405F71B9954BF004425E1 /* Frameworks */, 134 | 117405F81B9954BF004425E1 /* Resources */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | 117405FD1B9954BF004425E1 /* PBXTargetDependency */, 140 | ); 141 | name = RNHTMLtoPDFTests; 142 | productName = RNHTMLtoPDFTests; 143 | productReference = 117405FA1B9954BF004425E1 /* RNHTMLtoPDFTests.xctest */; 144 | productType = "com.apple.product-type.bundle.unit-test"; 145 | }; 146 | /* End PBXNativeTarget section */ 147 | 148 | /* Begin PBXProject section */ 149 | 117405E71B9954BF004425E1 /* Project object */ = { 150 | isa = PBXProject; 151 | attributes = { 152 | LastUpgradeCheck = 0640; 153 | ORGANIZATIONNAME = "Blick Labs"; 154 | TargetAttributes = { 155 | 117405EE1B9954BF004425E1 = { 156 | CreatedOnToolsVersion = 6.4; 157 | }; 158 | 117405F91B9954BF004425E1 = { 159 | CreatedOnToolsVersion = 6.4; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 117405EA1B9954BF004425E1 /* Build configuration list for PBXProject "RNHTMLtoPDF" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | ); 170 | mainGroup = 117405E61B9954BF004425E1; 171 | productRefGroup = 117405F01B9954BF004425E1 /* Products */; 172 | projectDirPath = ""; 173 | projectRoot = ""; 174 | targets = ( 175 | 117405EE1B9954BF004425E1 /* RNHTMLtoPDF */, 176 | 117405F91B9954BF004425E1 /* RNHTMLtoPDFTests */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 117405F81B9954BF004425E1 /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXResourcesBuildPhase section */ 190 | 191 | /* Begin PBXSourcesBuildPhase section */ 192 | 117405EB1B9954BF004425E1 /* Sources */ = { 193 | isa = PBXSourcesBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | 117405F51B9954BF004425E1 /* RNHTMLtoPDF.m in Sources */, 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | }; 200 | 117405F61B9954BF004425E1 /* Sources */ = { 201 | isa = PBXSourcesBuildPhase; 202 | buildActionMask = 2147483647; 203 | files = ( 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | /* End PBXSourcesBuildPhase section */ 208 | 209 | /* Begin PBXTargetDependency section */ 210 | 117405FD1B9954BF004425E1 /* PBXTargetDependency */ = { 211 | isa = PBXTargetDependency; 212 | target = 117405EE1B9954BF004425E1 /* RNHTMLtoPDF */; 213 | targetProxy = 117405FC1B9954BF004425E1 /* PBXContainerItemProxy */; 214 | }; 215 | /* End PBXTargetDependency section */ 216 | 217 | /* Begin XCBuildConfiguration section */ 218 | 117406011B9954BF004425E1 /* Debug */ = { 219 | isa = XCBuildConfiguration; 220 | buildSettings = { 221 | ALWAYS_SEARCH_USER_PATHS = NO; 222 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 223 | CLANG_CXX_LIBRARY = "libc++"; 224 | CLANG_ENABLE_MODULES = YES; 225 | CLANG_ENABLE_OBJC_ARC = YES; 226 | CLANG_WARN_BOOL_CONVERSION = YES; 227 | CLANG_WARN_CONSTANT_CONVERSION = YES; 228 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 229 | CLANG_WARN_EMPTY_BODY = YES; 230 | CLANG_WARN_ENUM_CONVERSION = YES; 231 | CLANG_WARN_INT_CONVERSION = YES; 232 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 233 | CLANG_WARN_UNREACHABLE_CODE = YES; 234 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 235 | COPY_PHASE_STRIP = NO; 236 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 237 | ENABLE_STRICT_OBJC_MSGSEND = YES; 238 | GCC_C_LANGUAGE_STANDARD = gnu99; 239 | GCC_DYNAMIC_NO_PIC = NO; 240 | GCC_NO_COMMON_BLOCKS = YES; 241 | GCC_OPTIMIZATION_LEVEL = 0; 242 | GCC_PREPROCESSOR_DEFINITIONS = ( 243 | "DEBUG=1", 244 | "$(inherited)", 245 | ); 246 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 247 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 248 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 249 | GCC_WARN_UNDECLARED_SELECTOR = YES; 250 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 251 | GCC_WARN_UNUSED_FUNCTION = YES; 252 | GCC_WARN_UNUSED_VARIABLE = YES; 253 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 254 | MTL_ENABLE_DEBUG_INFO = YES; 255 | ONLY_ACTIVE_ARCH = YES; 256 | SDKROOT = iphoneos; 257 | }; 258 | name = Debug; 259 | }; 260 | 117406021B9954BF004425E1 /* Release */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | ALWAYS_SEARCH_USER_PATHS = NO; 264 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 265 | CLANG_CXX_LIBRARY = "libc++"; 266 | CLANG_ENABLE_MODULES = YES; 267 | CLANG_ENABLE_OBJC_ARC = YES; 268 | CLANG_WARN_BOOL_CONVERSION = YES; 269 | CLANG_WARN_CONSTANT_CONVERSION = YES; 270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 271 | CLANG_WARN_EMPTY_BODY = YES; 272 | CLANG_WARN_ENUM_CONVERSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 275 | CLANG_WARN_UNREACHABLE_CODE = YES; 276 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 277 | COPY_PHASE_STRIP = NO; 278 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 279 | ENABLE_NS_ASSERTIONS = NO; 280 | ENABLE_STRICT_OBJC_MSGSEND = YES; 281 | GCC_C_LANGUAGE_STANDARD = gnu99; 282 | GCC_NO_COMMON_BLOCKS = YES; 283 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 284 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 285 | GCC_WARN_UNDECLARED_SELECTOR = YES; 286 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 287 | GCC_WARN_UNUSED_FUNCTION = YES; 288 | GCC_WARN_UNUSED_VARIABLE = YES; 289 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 290 | MTL_ENABLE_DEBUG_INFO = NO; 291 | SDKROOT = iphoneos; 292 | VALIDATE_PRODUCT = YES; 293 | }; 294 | name = Release; 295 | }; 296 | 117406041B9954BF004425E1 /* Debug */ = { 297 | isa = XCBuildConfiguration; 298 | buildSettings = { 299 | HEADER_SEARCH_PATHS = ( 300 | "$(inherited)", 301 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 302 | "$(SRCROOT)/../react-native/React/**", 303 | "$(SRCROOT)/node_modules/react-native/React/**", 304 | ); 305 | OTHER_LDFLAGS = "-ObjC"; 306 | PRODUCT_NAME = "$(TARGET_NAME)"; 307 | SKIP_INSTALL = YES; 308 | }; 309 | name = Debug; 310 | }; 311 | 117406051B9954BF004425E1 /* Release */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | HEADER_SEARCH_PATHS = ( 315 | "$(inherited)", 316 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 317 | "$(SRCROOT)/../react-native/React/**", 318 | "$(SRCROOT)/node_modules/react-native/React/**", 319 | ); 320 | OTHER_LDFLAGS = "-ObjC"; 321 | PRODUCT_NAME = "$(TARGET_NAME)"; 322 | SKIP_INSTALL = YES; 323 | }; 324 | name = Release; 325 | }; 326 | 117406071B9954BF004425E1 /* Debug */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 330 | FRAMEWORK_SEARCH_PATHS = ( 331 | "$(SDKROOT)/Developer/Library/Frameworks", 332 | "$(inherited)", 333 | ); 334 | GCC_PREPROCESSOR_DEFINITIONS = ( 335 | "DEBUG=1", 336 | "$(inherited)", 337 | ); 338 | INFOPLIST_FILE = RNHTMLtoPDFTests/Info.plist; 339 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 340 | PRODUCT_NAME = "$(TARGET_NAME)"; 341 | }; 342 | name = Debug; 343 | }; 344 | 117406081B9954BF004425E1 /* Release */ = { 345 | isa = XCBuildConfiguration; 346 | buildSettings = { 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | FRAMEWORK_SEARCH_PATHS = ( 349 | "$(SDKROOT)/Developer/Library/Frameworks", 350 | "$(inherited)", 351 | ); 352 | INFOPLIST_FILE = RNHTMLtoPDFTests/Info.plist; 353 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 354 | PRODUCT_NAME = "$(TARGET_NAME)"; 355 | }; 356 | name = Release; 357 | }; 358 | /* End XCBuildConfiguration section */ 359 | 360 | /* Begin XCConfigurationList section */ 361 | 117405EA1B9954BF004425E1 /* Build configuration list for PBXProject "RNHTMLtoPDF" */ = { 362 | isa = XCConfigurationList; 363 | buildConfigurations = ( 364 | 117406011B9954BF004425E1 /* Debug */, 365 | 117406021B9954BF004425E1 /* Release */, 366 | ); 367 | defaultConfigurationIsVisible = 0; 368 | defaultConfigurationName = Release; 369 | }; 370 | 117406031B9954BF004425E1 /* Build configuration list for PBXNativeTarget "RNHTMLtoPDF" */ = { 371 | isa = XCConfigurationList; 372 | buildConfigurations = ( 373 | 117406041B9954BF004425E1 /* Debug */, 374 | 117406051B9954BF004425E1 /* Release */, 375 | ); 376 | defaultConfigurationIsVisible = 0; 377 | }; 378 | 117406061B9954BF004425E1 /* Build configuration list for PBXNativeTarget "RNHTMLtoPDFTests" */ = { 379 | isa = XCConfigurationList; 380 | buildConfigurations = ( 381 | 117406071B9954BF004425E1 /* Debug */, 382 | 117406081B9954BF004425E1 /* Release */, 383 | ); 384 | defaultConfigurationIsVisible = 0; 385 | }; 386 | /* End XCConfigurationList section */ 387 | }; 388 | rootObject = 117405E71B9954BF004425E1 /* Project object */; 389 | } 390 | -------------------------------------------------------------------------------- /ios/RNHTMLtoPDF.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/RNHTMLtoPDF/RNHTMLtoPDF.h: -------------------------------------------------------------------------------- 1 | 2 | // Created by Christopher on 9/3/15. 3 | 4 | #import 5 | #import 6 | 7 | @interface RNHTMLtoPDF : RCTView 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /ios/RNHTMLtoPDF/RNHTMLtoPDF.m: -------------------------------------------------------------------------------- 1 | 2 | // Created by Christopher on 9/3/15. 3 | 4 | #import 5 | #import 6 | #import 7 | #import 8 | #import 9 | #import 10 | #import "RNHTMLtoPDF.h" 11 | 12 | #define PDFSize CGSizeMake(612,792) 13 | 14 | @implementation UIPrintPageRenderer (PDF) 15 | - (NSData*) printToPDF 16 | { 17 | NSMutableData *pdfData = [NSMutableData data]; 18 | UIGraphicsBeginPDFContextToData( pdfData, self.paperRect, nil ); 19 | 20 | [self prepareForDrawingPages: NSMakeRange(0, self.numberOfPages)]; 21 | 22 | CGRect bounds = UIGraphicsGetPDFContextBounds(); 23 | 24 | for ( int i = 0 ; i < self.numberOfPages ; i++ ) 25 | { 26 | UIGraphicsBeginPDFPage(); 27 | [self drawPageAtIndex: i inRect: bounds]; 28 | } 29 | 30 | UIGraphicsEndPDFContext(); 31 | return pdfData; 32 | } 33 | @end 34 | 35 | @implementation RNHTMLtoPDF { 36 | RCTEventDispatcher *_eventDispatcher; 37 | RCTPromiseResolveBlock _resolveBlock; 38 | RCTPromiseRejectBlock _rejectBlock; 39 | NSString *_html; 40 | NSString *_fileName; 41 | NSString *_filePath; 42 | CGSize _PDFSize; 43 | UIWebView *_webView; 44 | float _padding; 45 | BOOL _base64; 46 | BOOL autoHeight; 47 | } 48 | 49 | RCT_EXPORT_MODULE(); 50 | 51 | @synthesize bridge = _bridge; 52 | 53 | - (instancetype)init 54 | { 55 | if (self = [super init]) { 56 | _webView = [[UIWebView alloc] initWithFrame:self.bounds]; 57 | _webView.delegate = self; 58 | [self addSubview:_webView]; 59 | autoHeight = false; 60 | } 61 | return self; 62 | } 63 | 64 | RCT_EXPORT_METHOD(convert:(NSDictionary *)options 65 | resolver:(RCTPromiseResolveBlock)resolve 66 | rejecter:(RCTPromiseRejectBlock)reject) { 67 | 68 | if (options[@"html"]){ 69 | _html = [RCTConvert NSString:options[@"html"]]; 70 | } 71 | 72 | if (options[@"fileName"]){ 73 | _fileName = [RCTConvert NSString:options[@"fileName"]]; 74 | } else { 75 | _fileName = [[NSProcessInfo processInfo] globallyUniqueString]; 76 | } 77 | 78 | if (options[@"directory"] && [options[@"directory"] isEqualToString:@"docs"]){ 79 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 80 | NSString *documentsPath = [paths objectAtIndex:0]; 81 | 82 | _filePath = [NSString stringWithFormat:@"%@/%@.pdf", documentsPath, _fileName]; 83 | } else { 84 | _filePath = [NSString stringWithFormat:@"%@%@.pdf", NSTemporaryDirectory(), _fileName]; 85 | } 86 | 87 | if (options[@"base64"] && [options[@"base64"] boolValue]) { 88 | _base64 = true; 89 | } else { 90 | _base64 = false; 91 | } 92 | 93 | if (options[@"height"] && options[@"width"]) { 94 | float width = [RCTConvert float:options[@"width"]]; 95 | float height = [RCTConvert float:options[@"height"]]; 96 | _PDFSize = CGSizeMake(width, height); 97 | } else { 98 | _PDFSize = PDFSize; 99 | } 100 | 101 | if (options[@"padding"]) { 102 | _padding = [RCTConvert float:options[@"padding"]]; 103 | } else { 104 | _padding = 10.0f; 105 | } 106 | 107 | NSString *path = [[NSBundle mainBundle] bundlePath]; 108 | NSURL *baseURL = [NSURL fileURLWithPath:path]; 109 | 110 | [_webView loadHTMLString:_html baseURL:baseURL]; 111 | 112 | _resolveBlock = resolve; 113 | _rejectBlock = reject; 114 | 115 | } 116 | 117 | - (void)webViewDidFinishLoad:(UIWebView *)awebView 118 | { 119 | if (awebView.isLoading) 120 | return; 121 | 122 | UIPrintPageRenderer *render = [[UIPrintPageRenderer alloc] init]; 123 | [render addPrintFormatter:awebView.viewPrintFormatter startingAtPageAtIndex:0]; 124 | 125 | // Define the printableRect and paperRect 126 | // If the printableRect defines the printable area of the page 127 | CGRect paperRect = CGRectMake(0, 0, _PDFSize.width, _PDFSize.height); 128 | CGRect printableRect = CGRectMake(_padding, _padding, _PDFSize.width-(_padding * 2), _PDFSize.height-(_padding * 2)); 129 | 130 | [render setValue:[NSValue valueWithCGRect:paperRect] forKey:@"paperRect"]; 131 | [render setValue:[NSValue valueWithCGRect:printableRect] forKey:@"printableRect"]; 132 | 133 | NSData *pdfData = [render printToPDF]; 134 | 135 | if (pdfData) { 136 | NSString *pdfBase64 = @""; 137 | 138 | [pdfData writeToFile:_filePath atomically:YES]; 139 | if (_base64) { 140 | pdfBase64 = [pdfData base64EncodedStringWithOptions:0]; 141 | } 142 | NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys: 143 | pdfBase64, @"base64", 144 | _filePath, @"filePath", nil]; 145 | _resolveBlock(data); 146 | } else { 147 | NSError *error; 148 | _rejectBlock(RCTErrorUnspecified, nil, RCTErrorWithMessage(error.description)); 149 | } 150 | } 151 | 152 | @end 153 | -------------------------------------------------------------------------------- /ios/RNHTMLtoPDFTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.blick-labs.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-html-to-pdf", 3 | "version": "0.5.0", 4 | "scripts": { 5 | "start": "node_modules/react-native/packager/packager.sh" 6 | }, 7 | "description": "Convert html strings to PDF documents using React Native", 8 | "repository": { 9 | "type": "git", 10 | "url": "github:christopherdro/react-native-html-to-pdf" 11 | }, 12 | "keywords": [ 13 | "html", 14 | "pdf", 15 | "react-native" 16 | ], 17 | "author": "Christopher Dro (http://chris.si)", 18 | "license": "MIT" 19 | } 20 | --------------------------------------------------------------------------------