├── .github └── stale.yml ├── .gitignore ├── .npmignore ├── 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 └── react-native-html-to-pdf.podspec /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 120 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - security 8 | # Label to use when marking an issue as stale 9 | staleLabel: stale 10 | # Comment to post when marking an issue as stale. Set to `false` to disable 11 | markComment: > 12 | This issue has been automatically marked as stale because it has not had 13 | recent activity. It will be closed if no further activity occurs. Thank you 14 | for your contributions. 15 | # Comment to post when closing a stale issue. Set to `false` to disable 16 | closeComment: false 17 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /example -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Christopher Dro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /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 | - Edit `android/settings.gradle` to included 23 | 24 | ```java 25 | include ':react-native-html-to-pdf' 26 | project(':react-native-html-to-pdf').projectDir = new File(rootProject.projectDir,'../node_modules/react-native-html-to-pdf/android') 27 | ``` 28 | 29 | - Edit `android/app/build.gradle` file to include 30 | 31 | ```java 32 | dependencies { 33 | .... 34 | compile project(':react-native-html-to-pdf') 35 | 36 | } 37 | ``` 38 | 39 | - Edit `MainApplication.java` to include 40 | 41 | ```java 42 | // import the package 43 | import com.christopherdro.htmltopdf.RNHTMLtoPDFPackage; 44 | 45 | // include package 46 | new MainReactPackage(), 47 | new RNHTMLtoPDFPackage() 48 | ``` 49 | 50 | - Add the following `WRITE_EXTERNAL_STORAGE` permission to `AndroidManifest.xml` 51 | 52 | ```xml 53 | 54 | ``` 55 | Also starting from Android M, users need to be prompted for permission dynamically. Follow [this](https://facebook.github.io/react-native/docs/permissionsandroid) link for more details on how to do that. 56 | 57 | 58 | ## Usage 59 | ```javascript 60 | 61 | import React, { Component } from 'react'; 62 | 63 | import { 64 | Text, 65 | TouchableHighlight, 66 | View, 67 | } from 'react-native'; 68 | 69 | import RNHTMLtoPDF from 'react-native-html-to-pdf'; 70 | 71 | export default class Example extends Component { 72 | async createPDF() { 73 | let options = { 74 | html: '

PDF TEST

', 75 | fileName: 'test', 76 | directory: 'Documents', 77 | }; 78 | 79 | let file = await RNHTMLtoPDF.convert(options) 80 | // console.log(file.filePath); 81 | alert(file.filePath); 82 | } 83 | 84 | render() { 85 | return( 86 | 87 | 88 | Create PDF 89 | 90 | 91 | ) 92 | } 93 | } 94 | ``` 95 | 96 | ## Options 97 | 98 | | Param | Type | Default | Note | 99 | |---|---|---|---| 100 | | `html` | `string` | | HTML string to be converted 101 | | `fileName` | `string` | Random | Custom Filename excluding .pdf extension 102 | | `base64` | `boolean` | false | return base64 string of pdf file (not recommended) 103 | | `directory` | `string` |default cache directory| Directory where the file will be created (`Documents` folder in example above). Please note, on iOS `Documents` is the only custom value that is accepted. 104 | | `height` | number | 792 | Set document height (points) 105 | | `width` | number | 612 | Set document width (points) 106 | 107 | 108 | #### iOS Only 109 | 110 | | Param | Type | Default | Note | 111 | |---|---|---|---| 112 | | `paddingLeft` | number | 10 | Outer left padding (points) 113 | | `paddingRight` | number | 10 | Outer right padding (points) 114 | | `paddingTop` | number | 10 | Outer top padding (points) 115 | | `paddingBottom` | number | 10 | Outer bottom padding (points) 116 | | `padding` | number | 10 | Outer padding for any side (points), overrides any padding listed before 117 | | `bgColor` | string | #F6F5F0 | Background color in Hexadecimal 118 | 119 | 120 | #### Android Only 121 | 122 | | Param | Type | Default | Note | 123 | |---|---|---|---| 124 | | `fonts` | Array | | Allow custom fonts `['/fonts/TimesNewRoman.ttf', '/fonts/Verdana.ttf']` 125 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | buildscript { 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.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 | def safeExtGet(prop, fallback) { 16 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 17 | } 18 | 19 | apply plugin: 'com.android.library' 20 | 21 | android { 22 | compileSdkVersion safeExtGet('compileSdkVersion', 28) 23 | compileOptions { 24 | sourceCompatibility JavaVersion.VERSION_1_8 25 | targetCompatibility JavaVersion.VERSION_1_8 26 | } 27 | 28 | defaultConfig { 29 | minSdkVersion safeExtGet('minSdkVersion', 16) 30 | targetSdkVersion safeExtGet('targetSdkVersion', 28) 31 | versionCode 1 32 | versionName "1.0" 33 | ndk { 34 | abiFilters "armeabi-v7a", "x86" 35 | } 36 | } 37 | } 38 | 39 | repositories { 40 | mavenCentral() 41 | } 42 | 43 | 44 | dependencies { 45 | implementation 'com.tom-roush:pdfbox-android:1.8.10.3' 46 | implementation 'com.facebook.react:react-native:+' 47 | } 48 | -------------------------------------------------------------------------------- /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 android.webkit.WebSettings; 17 | import java.io.File; 18 | import android.util.Base64; 19 | import java.io.IOException; 20 | import java.io.RandomAccessFile; 21 | 22 | import com.facebook.react.bridge.Promise; 23 | import com.facebook.react.bridge.WritableMap; 24 | 25 | import com.tom_roush.pdfbox.pdmodel.PDDocument; 26 | 27 | /** 28 | * Converts HTML to PDF. 29 | *

30 | * Can convert only one task at a time, any requests to do more conversions before 31 | * ending the current task are ignored. 32 | */ 33 | public class PdfConverter implements Runnable { 34 | 35 | private static final String TAG = "PdfConverter"; 36 | private static PdfConverter sInstance; 37 | 38 | private Context mContext; 39 | private String mHtmlString; 40 | private File mPdfFile; 41 | private PrintAttributes mPdfPrintAttrs; 42 | private boolean mIsCurrentlyConverting; 43 | private WebView mWebView; 44 | private boolean mShouldEncode; 45 | private WritableMap mResultMap; 46 | private Promise mPromise; 47 | private String mBaseURL; 48 | 49 | private PdfConverter() { 50 | } 51 | 52 | public static synchronized PdfConverter getInstance() { 53 | if (sInstance == null) 54 | sInstance = new PdfConverter(); 55 | 56 | return sInstance; 57 | } 58 | 59 | @Override 60 | public void run() { 61 | mWebView = new WebView(mContext); 62 | mWebView.setWebViewClient(new WebViewClient() { 63 | @Override 64 | public void onPageFinished(WebView view, String url) { 65 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) 66 | throw new RuntimeException("call requires API level 19"); 67 | else { 68 | PrintDocumentAdapter documentAdapter = mWebView.createPrintDocumentAdapter(); 69 | documentAdapter.onLayout(null, getPdfPrintAttrs(), null, new PrintDocumentAdapter.LayoutResultCallback() { 70 | }, null); 71 | documentAdapter.onWrite(new PageRange[]{PageRange.ALL_PAGES}, getOutputFileDescriptor(), null, new PrintDocumentAdapter.WriteResultCallback() { 72 | @Override 73 | public void onWriteFinished(PageRange[] pages) { 74 | try { 75 | String base64 = ""; 76 | if (mShouldEncode) { 77 | base64 = encodeFromFile(mPdfFile); 78 | } 79 | 80 | PDDocument myDocument = PDDocument.load(mPdfFile); 81 | int pagesToBePrinted = myDocument.getNumberOfPages(); 82 | 83 | mResultMap.putString("filePath", mPdfFile.getAbsolutePath()); 84 | mResultMap.putString("numberOfPages", String.valueOf(pagesToBePrinted)); 85 | mResultMap.putString("base64", base64); 86 | mPromise.resolve(mResultMap); 87 | } catch (IOException e) { 88 | mPromise.reject(e.getMessage()); 89 | } finally { 90 | destroy(); 91 | } 92 | } 93 | 94 | @Override 95 | public void onWriteFailed(CharSequence error) { 96 | String errorResult = "Please retry, Error occurred generating the pdf"; 97 | if (error != null) { 98 | errorResult = error.toString(); 99 | } 100 | mPromise.reject(errorResult); 101 | destroy(); 102 | } 103 | 104 | @Override 105 | public void onWriteCancelled() { 106 | destroy(); 107 | } 108 | 109 | }); 110 | } 111 | } 112 | }); 113 | WebSettings settings = mWebView.getSettings(); 114 | settings.setTextZoom(100); 115 | settings.setDefaultTextEncodingName("utf-8"); 116 | settings.setAllowFileAccess(true); 117 | mWebView.loadDataWithBaseURL(mBaseURL, mHtmlString, "text/HTML", "utf-8", null); 118 | } 119 | 120 | public PrintAttributes getPdfPrintAttrs() { 121 | return mPdfPrintAttrs != null ? mPdfPrintAttrs : getDefaultPrintAttrs(); 122 | } 123 | 124 | public void setPdfPrintAttrs(PrintAttributes printAttrs) { 125 | this.mPdfPrintAttrs = printAttrs; 126 | } 127 | 128 | public void convert(Context context, String htmlString, File file, boolean shouldEncode, WritableMap resultMap, 129 | Promise promise, String baseURL) throws Exception { 130 | if (context == null) 131 | throw new Exception("context can't be null"); 132 | if (htmlString == null) 133 | throw new Exception("htmlString can't be null"); 134 | if (file == null) 135 | throw new Exception("file can't be null"); 136 | 137 | if (mIsCurrentlyConverting) 138 | return; 139 | 140 | mContext = context; 141 | mHtmlString = htmlString; 142 | mPdfFile = file; 143 | mIsCurrentlyConverting = true; 144 | mShouldEncode = shouldEncode; 145 | mResultMap = resultMap; 146 | mPromise = promise; 147 | mBaseURL = baseURL; 148 | runOnUiThread(this); 149 | } 150 | 151 | private ParcelFileDescriptor getOutputFileDescriptor() { 152 | try { 153 | mPdfFile.createNewFile(); 154 | return ParcelFileDescriptor.open(mPdfFile, ParcelFileDescriptor.MODE_TRUNCATE | ParcelFileDescriptor.MODE_READ_WRITE); 155 | } catch (Exception e) { 156 | Log.d(TAG, "Failed to open ParcelFileDescriptor", e); 157 | } 158 | return null; 159 | } 160 | 161 | private PrintAttributes getDefaultPrintAttrs() { 162 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return null; 163 | 164 | return new PrintAttributes.Builder() 165 | .setMediaSize(PrintAttributes.MediaSize.NA_LETTER) 166 | .setResolution(new PrintAttributes.Resolution("RESOLUTION_ID", "RESOLUTION_ID", 600, 600)) 167 | .setMinMargins(PrintAttributes.Margins.NO_MARGINS) 168 | .build(); 169 | 170 | } 171 | 172 | private void runOnUiThread(Runnable runnable) { 173 | Handler handler = new Handler(mContext.getMainLooper()); 174 | handler.post(runnable); 175 | } 176 | 177 | private void destroy() { 178 | mContext = null; 179 | mHtmlString = null; 180 | mPdfFile = null; 181 | mPdfPrintAttrs = null; 182 | mIsCurrentlyConverting = false; 183 | mWebView = null; 184 | mShouldEncode = false; 185 | mResultMap = null; 186 | mPromise = null; 187 | } 188 | 189 | private String encodeFromFile(File file) throws IOException{ 190 | RandomAccessFile randomAccessFile = new RandomAccessFile(file, "r"); 191 | byte[] fileBytes = new byte[(int)randomAccessFile.length()]; 192 | randomAccessFile.readFully(fileBytes); 193 | return Base64.encodeToString(fileBytes, Base64.DEFAULT); 194 | } 195 | } 196 | -------------------------------------------------------------------------------- /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.io.IOException; 13 | import java.util.UUID; 14 | 15 | import android.os.Environment; 16 | import android.print.PdfConverter; 17 | import android.print.PrintAttributes; 18 | 19 | public class RNHTMLtoPDFModule extends ReactContextBaseJavaModule { 20 | 21 | private static final String HTML = "html"; 22 | private static final String FILE_NAME = "fileName"; 23 | private static final String DIRECTORY = "directory"; 24 | private static final String BASE_64 = "base64"; 25 | private static final String BASE_URL = "baseURL"; 26 | private static final String HEIGHT = "height"; 27 | private static final String WIDTH = "width"; 28 | 29 | private static final String PDF_EXTENSION = ".pdf"; 30 | private static final String PDF_PREFIX = "PDF_"; 31 | 32 | private final ReactApplicationContext mReactContext; 33 | 34 | public RNHTMLtoPDFModule(ReactApplicationContext reactContext) { 35 | super(reactContext); 36 | mReactContext = reactContext; 37 | } 38 | 39 | @Override 40 | public String getName() { 41 | return "RNHTMLtoPDF"; 42 | } 43 | 44 | @ReactMethod 45 | public void convert(final ReadableMap options, final Promise promise) { 46 | try { 47 | File destinationFile; 48 | String htmlString = options.hasKey(HTML) ? options.getString(HTML) : null; 49 | if (htmlString == null) { 50 | promise.reject(new Exception("RNHTMLtoPDF error: Invalid htmlString parameter.")); 51 | return; 52 | } 53 | 54 | String fileName; 55 | if (options.hasKey(FILE_NAME)) { 56 | fileName = options.getString(FILE_NAME); 57 | if (!isFileNameValid(fileName)) { 58 | promise.reject(new Exception("RNHTMLtoPDF error: Invalid fileName parameter.")); 59 | return; 60 | } 61 | } else { 62 | fileName = PDF_PREFIX + UUID.randomUUID().toString(); 63 | } 64 | 65 | if (options.hasKey(DIRECTORY)) { 66 | String state = Environment.getExternalStorageState(); 67 | File path = (Environment.MEDIA_MOUNTED.equals(state)) ? 68 | new File(mReactContext.getExternalFilesDir(null), options.getString(DIRECTORY)) : 69 | new File(mReactContext.getFilesDir(), options.getString(DIRECTORY)); 70 | 71 | if (!path.exists()) { 72 | if (!path.mkdirs()) { 73 | promise.reject(new Exception("RNHTMLtoPDF error: Could not create folder structure.")); 74 | return; 75 | } 76 | } 77 | destinationFile = new File(path, fileName + PDF_EXTENSION); 78 | } else { 79 | destinationFile = getTempFile(fileName); 80 | } 81 | 82 | PrintAttributes pagesize=null; 83 | if(options.hasKey(HEIGHT) && options.hasKey(WIDTH)) { 84 | pagesize=new PrintAttributes.Builder() 85 | .setMediaSize(new PrintAttributes.MediaSize("custom","CUSTOM", 86 | (int)(options.getInt(WIDTH)*1000/72.0), 87 | (int)(options.getInt(HEIGHT)*1000/72.0)) 88 | ) 89 | .setResolution(new PrintAttributes.Resolution("RESOLUTION_ID", "RESOLUTION_ID", 600, 600)) 90 | .setMinMargins(PrintAttributes.Margins.NO_MARGINS) 91 | .build(); 92 | } 93 | 94 | convertToPDF(htmlString, 95 | destinationFile, 96 | options.hasKey(BASE_64) && options.getBoolean(BASE_64), 97 | Arguments.createMap(), 98 | promise, 99 | options.hasKey(BASE_URL) ? options.getString(BASE_URL) : null, 100 | pagesize 101 | ); 102 | } catch (Exception e) { 103 | promise.reject(e); 104 | } 105 | } 106 | 107 | private void convertToPDF(String htmlString, File file, boolean shouldEncode, WritableMap resultMap, Promise promise, 108 | String baseURL,PrintAttributes printAttributes) throws Exception { 109 | PdfConverter pdfConverter=PdfConverter.getInstance(); 110 | if(printAttributes!=null) pdfConverter.setPdfPrintAttrs(printAttributes); 111 | pdfConverter.convert(mReactContext, htmlString, file, shouldEncode, resultMap, promise, baseURL); 112 | } 113 | 114 | private File getTempFile(String fileName) throws IOException { 115 | File outputDir = getReactApplicationContext().getCacheDir(); 116 | return File.createTempFile(fileName, PDF_EXTENSION, outputDir); 117 | 118 | } 119 | 120 | private boolean isFileNameValid(String fileName) throws Exception { 121 | return new File(fileName).getCanonicalFile().getName().equals(fileName); 122 | } 123 | } 124 | 125 | -------------------------------------------------------------------------------- /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/christopherdro/react-native-html-to-pdf/0d77c62b70b9ef599bc7973f0073419769cec78d/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/christopherdro/react-native-html-to-pdf/0d77c62b70b9ef599bc7973f0073419769cec78d/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/christopherdro/react-native-html-to-pdf/0d77c62b70b9ef599bc7973f0073419769cec78d/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/christopherdro/react-native-html-to-pdf/0d77c62b70b9ef599bc7973f0073419769cec78d/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/christopherdro/react-native-html-to-pdf/0d77c62b70b9ef599bc7973f0073419769cec78d/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.6.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 | #import 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 11 | #import "RNHTMLtoPDF.h" 12 | 13 | #define PDFSize CGSizeMake(612,792) 14 | 15 | @implementation UIPrintPageRenderer (PDF) 16 | - (NSData*) printToPDF:(NSInteger**)_numberOfPages 17 | backgroundColor:(UIColor*)_bgColor 18 | { 19 | NSMutableData *pdfData = [NSMutableData data]; 20 | UIGraphicsBeginPDFContextToData( pdfData, self.paperRect, nil ); 21 | 22 | [self prepareForDrawingPages: NSMakeRange(0, self.numberOfPages)]; 23 | 24 | CGRect bounds = UIGraphicsGetPDFContextBounds(); 25 | 26 | for ( int i = 0 ; i < self.numberOfPages ; i++ ) 27 | { 28 | UIGraphicsBeginPDFPage(); 29 | 30 | 31 | CGContextRef currentContext = UIGraphicsGetCurrentContext(); 32 | CGContextSetFillColorWithColor(currentContext, _bgColor.CGColor); 33 | CGContextFillRect(currentContext, self.paperRect); 34 | 35 | [self drawPageAtIndex: i inRect: bounds]; 36 | } 37 | 38 | *_numberOfPages = self.numberOfPages; 39 | 40 | UIGraphicsEndPDFContext(); 41 | return pdfData; 42 | } 43 | @end 44 | 45 | @implementation RNHTMLtoPDF { 46 | RCTEventDispatcher *_eventDispatcher; 47 | RCTPromiseResolveBlock _resolveBlock; 48 | RCTPromiseRejectBlock _rejectBlock; 49 | NSString *_html; 50 | NSString *_fileName; 51 | NSString *_filePath; 52 | UIColor *_bgColor; 53 | NSInteger *_numberOfPages; 54 | CGSize _PDFSize; 55 | WKWebView *_webView; 56 | float _paddingBottom; 57 | float _paddingTop; 58 | float _paddingLeft; 59 | float _paddingRight; 60 | BOOL _base64; 61 | BOOL autoHeight; 62 | } 63 | 64 | RCT_EXPORT_MODULE(); 65 | 66 | + (BOOL)requiresMainQueueSetup 67 | { 68 | return YES; 69 | } 70 | 71 | @synthesize bridge = _bridge; 72 | 73 | - (instancetype)init 74 | { 75 | if (self = [super init]) { 76 | _webView = [[WKWebView alloc] initWithFrame:self.bounds]; 77 | _webView.navigationDelegate = self; 78 | [self addSubview:_webView]; 79 | autoHeight = false; 80 | } 81 | return self; 82 | } 83 | 84 | RCT_EXPORT_METHOD(convert:(NSDictionary *)options 85 | resolver:(RCTPromiseResolveBlock)resolve 86 | rejecter:(RCTPromiseRejectBlock)reject) { 87 | 88 | if (options[@"html"]){ 89 | _html = [RCTConvert NSString:options[@"html"]]; 90 | } 91 | 92 | if (options[@"fileName"]){ 93 | _fileName = [RCTConvert NSString:options[@"fileName"]]; 94 | } else { 95 | _fileName = [[NSProcessInfo processInfo] globallyUniqueString]; 96 | } 97 | 98 | // Default Color 99 | _bgColor = [UIColor colorWithRed: (246.0/255.0) green:(245.0/255.0) blue:(240.0/255.0) alpha:1]; 100 | if (options[@"bgColor"]){ 101 | NSString *hex = [RCTConvert NSString:options[@"bgColor"]]; 102 | hex = [hex uppercaseString]; 103 | NSString *cString = [hex stringByTrimmingCharactersInSet: 104 | [NSCharacterSet whitespaceAndNewlineCharacterSet]]; 105 | 106 | if ((cString.length) == 7) { 107 | NSScanner *scanner = [NSScanner scannerWithString:cString]; 108 | 109 | UInt32 rgbValue = 0; 110 | [scanner setScanLocation:1]; // Bypass '#' character 111 | [scanner scanHexInt:&rgbValue]; 112 | 113 | _bgColor = [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ 114 | green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 \ 115 | blue:((float)((rgbValue & 0x0000FF) >> 0))/255.0 \ 116 | alpha:1.0]; 117 | } 118 | } 119 | 120 | if (options[@"directory"] && [options[@"directory"] isEqualToString:@"Documents"]){ 121 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 122 | NSString *documentsPath = [paths objectAtIndex:0]; 123 | 124 | _filePath = [NSString stringWithFormat:@"%@/%@.pdf", documentsPath, _fileName]; 125 | } else { 126 | _filePath = [NSString stringWithFormat:@"%@%@.pdf", NSTemporaryDirectory(), _fileName]; 127 | } 128 | 129 | if (options[@"base64"] && [options[@"base64"] boolValue]) { 130 | _base64 = true; 131 | } else { 132 | _base64 = false; 133 | } 134 | 135 | if (options[@"height"] && options[@"width"]) { 136 | float width = [RCTConvert float:options[@"width"]]; 137 | float height = [RCTConvert float:options[@"height"]]; 138 | _PDFSize = CGSizeMake(width, height); 139 | } else { 140 | _PDFSize = PDFSize; 141 | } 142 | 143 | if (options[@"paddingBottom"]) { 144 | _paddingBottom = [RCTConvert float:options[@"paddingBottom"]]; 145 | } else { 146 | _paddingBottom = 10.0f; 147 | } 148 | 149 | if (options[@"paddingLeft"]) { 150 | _paddingLeft = [RCTConvert float:options[@"paddingLeft"]]; 151 | } else { 152 | _paddingLeft = 10.0f; 153 | } 154 | 155 | if (options[@"paddingTop"]) { 156 | _paddingTop = [RCTConvert float:options[@"paddingTop"]]; 157 | } else { 158 | _paddingTop = 10.0f; 159 | } 160 | 161 | if (options[@"paddingRight"]) { 162 | _paddingRight = [RCTConvert float:options[@"paddingRight"]]; 163 | } else { 164 | _paddingRight = 10.0f; 165 | } 166 | 167 | if (options[@"padding"]) { 168 | _paddingTop = [RCTConvert float:options[@"padding"]]; 169 | _paddingBottom = [RCTConvert float:options[@"padding"]]; 170 | _paddingLeft = [RCTConvert float:options[@"padding"]]; 171 | _paddingRight = [RCTConvert float:options[@"padding"]]; 172 | } 173 | 174 | NSString *path = [[NSBundle mainBundle] bundlePath]; 175 | NSURL *baseURL = [NSURL fileURLWithPath:path]; 176 | dispatch_async(dispatch_get_main_queue(), ^{ 177 | [_webView loadHTMLString:_html baseURL:baseURL]; 178 | }); 179 | 180 | _resolveBlock = resolve; 181 | _rejectBlock = reject; 182 | 183 | } 184 | -(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { 185 | if (webView.isLoading) 186 | return; 187 | 188 | UIPrintPageRenderer *render = [[UIPrintPageRenderer alloc] init]; 189 | [render addPrintFormatter:webView.viewPrintFormatter startingAtPageAtIndex:0]; 190 | 191 | // Define the printableRect and paperRect 192 | // If the printableRect defines the printable area of the page 193 | CGRect paperRect = CGRectMake(0, 0, _PDFSize.width, _PDFSize.height); 194 | CGRect printableRect = CGRectMake(_paddingLeft, _paddingTop, _PDFSize.width-(_paddingLeft + _paddingRight), _PDFSize.height-(_paddingBottom + _paddingTop)); 195 | 196 | 197 | [render setValue:[NSValue valueWithCGRect:paperRect] forKey:@"paperRect"]; 198 | [render setValue:[NSValue valueWithCGRect:printableRect] forKey:@"printableRect"]; 199 | 200 | NSData * pdfData = [render printToPDF:&_numberOfPages backgroundColor:_bgColor ]; 201 | 202 | if (pdfData) { 203 | NSString *pdfBase64 = @""; 204 | 205 | [pdfData writeToFile:_filePath atomically:YES]; 206 | if (_base64) { 207 | pdfBase64 = [pdfData base64EncodedStringWithOptions:0]; 208 | } 209 | NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys: 210 | pdfBase64, @"base64", 211 | [NSString stringWithFormat: @"%ld", (long)_numberOfPages], @"numberOfPages", 212 | _filePath, @"filePath", nil]; 213 | _resolveBlock(data); 214 | } else { 215 | NSError *error; 216 | _rejectBlock(RCTErrorUnspecified, nil, RCTErrorWithMessage(error.description)); 217 | } 218 | } 219 | 220 | @end 221 | -------------------------------------------------------------------------------- /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.12.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 | "homepage": "https://github.com/christopherdro/react-native-html-to-pdf", 19 | "license": "MIT" 20 | } 21 | -------------------------------------------------------------------------------- /react-native-html-to-pdf.podspec: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = package['name'] 7 | s.version = package['version'] 8 | s.summary = package['description'] 9 | s.license = package['license'] 10 | 11 | s.authors = package['author'] 12 | s.homepage = package['homepage'] 13 | s.platform = :ios, "9.0" 14 | 15 | s.source = { :git => "https://github.com/christopherdro/react-native-html-to-pdf.git", :tag => "v#{s.version}" } 16 | s.source_files = "ios/**/*.{h,m}" 17 | 18 | s.dependency 'React-Core' 19 | end 20 | --------------------------------------------------------------------------------