Giter Site home page Giter Site logo

fuse.pdf's Introduction

FUSE.PDF

Works on iOS & Android

Initatialisation.

You can initialize the module by simply require it in you JS file.

var PDF = require("PDF")

Base64 to PDF saved locally

You can decode the base64 pdf comming from the server by this way, the function takes one argument, the name of the file with his extention. the function return a path of where your file have been saved.

	function DecodeFromBase64(){
		PDF.DecodeFromBase64(data, "file.pdf").then(function(results){
			console.log(JSON.stringify(results))
		}, function(err){
			console.log(JSON.stringify(err))
		})
	}

Local pdf to Base64.

You can encode local pdf to base64 by this way, the fuction takes one argument, the name of the file saved in the application directoty with his extension. the function return a base64 encoded string.

function EncodePDFToBase64(){
	PDF.EncodeToBase64("file.pdf").then(function(base64){
		console.log(JSON.stringify(base64))
	}, function(err){
		console.log(JSON.stringify(err))
	})
}

View the pdf file on both iOS and Android.

for viewving you pdf file you will need to add Native.PDF inside a NativeViewHost. add an ux:Name to your Native.PDF and call on it Open function. Open function takes one argument , the name of the file you are trying to see and the .pdf extension

			<NativeViewHost>
				<Native.PDF ux:Name="PDFVIEW"/>
			</NativeViewHost>

		function ViewPDF(){
			PDFVIEW.Open("file.pdf");
		}

fuse.pdf's People

Contributors

princefr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.