SlideShare a Scribd company logo
1 of 13
Download to read offline
How to Build an Android App for Document Collaboration with PDFTron SDK
By: Jayasankar P M, Senior Software Engineer, RapidValue
How to Build an Android App for Document Collaboration with PDFTron SDK
Integrating PDFTron Android SDK – Getting Started!
Pre-requisites:
• Android Studio
• Project specifications:
Minimum API: 16 (using AndroidX)
Compile API: 29
Recommended target API: 29
If your app is using AndroidX, you will also need to add android.useAndroidX=true and
android.useAndroidX=true in your gradle.properties file. You can learn more about this
here.
• A valid license key
Steps:
This section will go through each component that is required to build your real-time
document collaboration app. This includes:
1. Add Firebase to Your Android Project
Firebase has a very comprehensive tutorial on how to add Firebase to your Android
project. Head here to get your project set up. Option 1 Add Firebase using the Firebase
console is recommended. By the end of this step, your Firebase project console will
recognize your Android app.
Next, let's add two additional packages: Firebase Authentication and Firebase
Realtime Database. In your app module's build.gradle file (usually app/build.gradle),
add the following:
2. Add PDFTron Android SDK to your Android project
© RapidValue Solutions 2
How to Build an Android App for Document Collaboration with PDFTron SDK
You can either integrate PDFTron packages automatically using Gradle, or install them
manually using .aar files by downloading the SDK.
Open the build.gradle file in your project's root directory:
Edit it to include the following inside the allprojects.repositories section to include
PDFTron's Maven repository:
Open the build.gradle file in your module directory:
Edit it to include the following dependencies to your project.
© RapidValue Solutions 3
How to Build an Android App for Document Collaboration with PDFTron SDK
In your project's root directory, find the gradle.properties file. Copy the following line to
it.
Open your AndroidManifest.xml file and add a <metadata> tag inside the <application>
tag to be a placeholder for the license key:
© RapidValue Solutions 4
How to Build an Android App for Document Collaboration with PDFTron SDK
3. Convert MS Office (Word, Excel, PowerPoint) to PDF
To convert an MS Office file to a PDF document without any external third party
dependencies.
© RapidValue Solutions 5
How to Build an Android App for Document Collaboration with PDFTron SDK
4. Preview PDF
This section will show you how to open a document in a DocumentActivity. This is an
AppCompatActivity which contains a PdfViewCtrlTabHostFragment and packages all
the standard features used during document viewing
The AndroidManifest.xml file needs to be updated to request permissions to allow
DocumentActivity to function properly. You also need to add some attributes to the
<application> tag as well as a new <activity> tag to define the DocumentActivity.
© RapidValue Solutions 6
How to Build an Android App for Document Collaboration with PDFTron SDK
5. Handling Incoming Annotation Data from the Server
Authentication
First, go to the Firebase console and click the "Authentication" button on the left panel
and then click the "Sign-in Method" tab, just to the right of "Users". From this page click
the "Anonymous" button and choose to enable anonymous login.
© RapidValue Solutions 7
How to Build an Android App for Document Collaboration with PDFTron SDK
Annotation Data Flow
After successfully authenticating the user and having obtained a user name, let's add
the user to the Firebase database and start subscribing to database changes.
© RapidValue Solutions 8
How to Build an Android App for Document Collaboration with PDFTron SDK
6. Sending Client Annotation Data to the Server
Next, let's add functionality to send client annotation changes to Firebase. PDFTron
stores your annotations in XFDF -- the ISO Standard Format for annotations
interchange -- which means your annotations can be preserved when sharing
documents with people using other tools. Code is as follows:
© RapidValue Solutions 9
How to Build an Android App for Document Collaboration with PDFTron SDK
7. Add the Collaboration Viewer
You can now connect your server to the PDFTron SDK's out-of-box collaboration UI, in
your MainActivity.kt:
© RapidValue Solutions 10
How to Build an Android App for Document Collaboration with PDFTron SDK
Customize a Document Viewer
PDFTron includes DocumentActivity and PdfViewCtrlTabHostFragment for showing
documents. To customize their appearance and function, see Customizing a document
viewer.
PDFTron also includes a low-level ViewGroup (PDFViewCtrl) to show documents. If you
are using it, please see Customizing a PDFViewCtrl.
New Document Viewer UI (Beta)
Version 7.1.5 of PDFTron's Android PDF SDK release includes a brand new viewer
PdfViewCtrlTabHostFragment2 which includes an updated user interface containing:
improvements to the annotation toolbar, a better multi-tab navigation experience,
improvements to stamp and signature flows, and more.
Conclusion
PDFTron SDK is an advanced framework for displaying and annotating PDFs on
Android. It brings a new collaborative document viewing experience to Android, making
use of PDFTron's powerful document viewing and editing features. PDFTron SDK is
© RapidValue Solutions 11
How to Build an Android App for Document Collaboration with PDFTron SDK
very straight forward, the interface is very easy to understand and all the features it
offers are simple. Using the PDFTron APIs and a server, you can set up real time
collaboration easily. It lets the users collaborate on documents across all platforms:
Web, Android, iOS, Windows & more. With PDFTron SDK, you can quickly provide
document collaboration on 30+ file types in your application. PDFTron has a relatively
stronger mobile platform when compared to the key competitors.
If you’re an Android developer and looking forward to learn how to integrate PDFTron
SDK in an Android Application, this article will help you how to do it right. Hope you find
it as easy to use.
Reference: https://www.pdftron.com/documentation/android/
© RapidValue Solutions 12
How to Build an Android App for Document Collaboration with PDFTron SDK
About RapidValue
RapidValue is a global leader in digital product engineering solutions including
mobility, omnichannel, IoT, AI, RPA and cloud to enterprises worldwide.
RapidValue offers its digital services to the world’s top brands, Fortune 1000
companies and innovative emerging start-ups. With offices in the United States,
the United Kingdom, Germany and India and operations spread across the
Middle-East, Europe and Canada, RapidValue delivers enterprise services and
solutions across various industry verticals.
Disclaimer:
This document contains information that is confidential and proprietary to RapidValue Solutions
Inc. No part of it may be used, circulated, quoted, or reproduced for distribution outside
RapidValue. If you are not the intended recipient of this report, you are hereby notified that the
use, circulation, quoting, or reproducing of this report is strictly prohibited and may be unlawful.
www.rapidvaluesolutions.com/blog
+1 877.643.1850 contactus@rapidvaluesolutions.com
www.rapidvaluesolutions.com
© RapidValue Solutions 13

More Related Content

More from RapidValue

Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360RapidValue
 
Python Google Cloud Function with CORS
Python Google Cloud Function with CORSPython Google Cloud Function with CORS
Python Google Cloud Function with CORSRapidValue
 
Real-time Automation Result in Slack Channel
Real-time Automation Result in Slack ChannelReal-time Automation Result in Slack Channel
Real-time Automation Result in Slack ChannelRapidValue
 
Automation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDDAutomation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDDRapidValue
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkRapidValue
 
Video Recording of Selenium Automation Flows
Video Recording of Selenium Automation FlowsVideo Recording of Selenium Automation Flows
Video Recording of Selenium Automation FlowsRapidValue
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterJMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterRapidValue
 
Migration to Extent Report 4
Migration to Extent Report 4Migration to Extent Report 4
Migration to Extent Report 4RapidValue
 
The Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QAThe Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QARapidValue
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsRapidValue
 
Test Case Creation in Katalon Studio
Test Case Creation in Katalon StudioTest Case Creation in Katalon Studio
Test Case Creation in Katalon StudioRapidValue
 
How to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using ValgrindHow to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using ValgrindRapidValue
 
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValueDevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValueRapidValue
 
A Technology Backgrounder to Serverless Architecture - A Whitepaper by RapidV...
A Technology Backgrounder to Serverless Architecture - A Whitepaper by RapidV...A Technology Backgrounder to Serverless Architecture - A Whitepaper by RapidV...
A Technology Backgrounder to Serverless Architecture - A Whitepaper by RapidV...RapidValue
 
MS Azure: Soaring High in the Cloud - An Infographic by RapidValue
MS Azure: Soaring High in the Cloud - An Infographic by RapidValueMS Azure: Soaring High in the Cloud - An Infographic by RapidValue
MS Azure: Soaring High in the Cloud - An Infographic by RapidValueRapidValue
 
An Essential Guide to Effective Test Automation Leveraging Open Source
An Essential Guide to Effective Test Automation Leveraging Open SourceAn Essential Guide to Effective Test Automation Leveraging Open Source
An Essential Guide to Effective Test Automation Leveraging Open SourceRapidValue
 
Cloud computing - The Trailblazer of Digital Transformation
Cloud computing - The Trailblazer of Digital TransformationCloud computing - The Trailblazer of Digital Transformation
Cloud computing - The Trailblazer of Digital TransformationRapidValue
 
Cloud Native IT Transformation - Whitepaper by RapidValue
Cloud Native IT Transformation - Whitepaper by RapidValueCloud Native IT Transformation - Whitepaper by RapidValue
Cloud Native IT Transformation - Whitepaper by RapidValueRapidValue
 
Amazon Web Services - Ruling the Cloud An Infographic by RapidValue Solutions
Amazon Web Services - Ruling the Cloud An Infographic by RapidValue SolutionsAmazon Web Services - Ruling the Cloud An Infographic by RapidValue Solutions
Amazon Web Services - Ruling the Cloud An Infographic by RapidValue SolutionsRapidValue
 
Digital Transformation in Manufacturing - A Whitepaper by RapidValue Solutions
Digital Transformation in Manufacturing - A Whitepaper by RapidValue SolutionsDigital Transformation in Manufacturing - A Whitepaper by RapidValue Solutions
Digital Transformation in Manufacturing - A Whitepaper by RapidValue SolutionsRapidValue
 

More from RapidValue (20)

Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360
 
Python Google Cloud Function with CORS
Python Google Cloud Function with CORSPython Google Cloud Function with CORS
Python Google Cloud Function with CORS
 
Real-time Automation Result in Slack Channel
Real-time Automation Result in Slack ChannelReal-time Automation Result in Slack Channel
Real-time Automation Result in Slack Channel
 
Automation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDDAutomation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDD
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
 
Video Recording of Selenium Automation Flows
Video Recording of Selenium Automation FlowsVideo Recording of Selenium Automation Flows
Video Recording of Selenium Automation Flows
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterJMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeter
 
Migration to Extent Report 4
Migration to Extent Report 4Migration to Extent Report 4
Migration to Extent Report 4
 
The Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QAThe Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QA
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API Requests
 
Test Case Creation in Katalon Studio
Test Case Creation in Katalon StudioTest Case Creation in Katalon Studio
Test Case Creation in Katalon Studio
 
How to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using ValgrindHow to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using Valgrind
 
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValueDevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
 
A Technology Backgrounder to Serverless Architecture - A Whitepaper by RapidV...
A Technology Backgrounder to Serverless Architecture - A Whitepaper by RapidV...A Technology Backgrounder to Serverless Architecture - A Whitepaper by RapidV...
A Technology Backgrounder to Serverless Architecture - A Whitepaper by RapidV...
 
MS Azure: Soaring High in the Cloud - An Infographic by RapidValue
MS Azure: Soaring High in the Cloud - An Infographic by RapidValueMS Azure: Soaring High in the Cloud - An Infographic by RapidValue
MS Azure: Soaring High in the Cloud - An Infographic by RapidValue
 
An Essential Guide to Effective Test Automation Leveraging Open Source
An Essential Guide to Effective Test Automation Leveraging Open SourceAn Essential Guide to Effective Test Automation Leveraging Open Source
An Essential Guide to Effective Test Automation Leveraging Open Source
 
Cloud computing - The Trailblazer of Digital Transformation
Cloud computing - The Trailblazer of Digital TransformationCloud computing - The Trailblazer of Digital Transformation
Cloud computing - The Trailblazer of Digital Transformation
 
Cloud Native IT Transformation - Whitepaper by RapidValue
Cloud Native IT Transformation - Whitepaper by RapidValueCloud Native IT Transformation - Whitepaper by RapidValue
Cloud Native IT Transformation - Whitepaper by RapidValue
 
Amazon Web Services - Ruling the Cloud An Infographic by RapidValue Solutions
Amazon Web Services - Ruling the Cloud An Infographic by RapidValue SolutionsAmazon Web Services - Ruling the Cloud An Infographic by RapidValue Solutions
Amazon Web Services - Ruling the Cloud An Infographic by RapidValue Solutions
 
Digital Transformation in Manufacturing - A Whitepaper by RapidValue Solutions
Digital Transformation in Manufacturing - A Whitepaper by RapidValue SolutionsDigital Transformation in Manufacturing - A Whitepaper by RapidValue Solutions
Digital Transformation in Manufacturing - A Whitepaper by RapidValue Solutions
 

Recently uploaded

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 

Recently uploaded (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 

How to Build an Android App for Document Collaboration with PDFTron SDK

  • 1. How to Build an Android App for Document Collaboration with PDFTron SDK By: Jayasankar P M, Senior Software Engineer, RapidValue
  • 2. How to Build an Android App for Document Collaboration with PDFTron SDK Integrating PDFTron Android SDK – Getting Started! Pre-requisites: • Android Studio • Project specifications: Minimum API: 16 (using AndroidX) Compile API: 29 Recommended target API: 29 If your app is using AndroidX, you will also need to add android.useAndroidX=true and android.useAndroidX=true in your gradle.properties file. You can learn more about this here. • A valid license key Steps: This section will go through each component that is required to build your real-time document collaboration app. This includes: 1. Add Firebase to Your Android Project Firebase has a very comprehensive tutorial on how to add Firebase to your Android project. Head here to get your project set up. Option 1 Add Firebase using the Firebase console is recommended. By the end of this step, your Firebase project console will recognize your Android app. Next, let's add two additional packages: Firebase Authentication and Firebase Realtime Database. In your app module's build.gradle file (usually app/build.gradle), add the following: 2. Add PDFTron Android SDK to your Android project © RapidValue Solutions 2
  • 3. How to Build an Android App for Document Collaboration with PDFTron SDK You can either integrate PDFTron packages automatically using Gradle, or install them manually using .aar files by downloading the SDK. Open the build.gradle file in your project's root directory: Edit it to include the following inside the allprojects.repositories section to include PDFTron's Maven repository: Open the build.gradle file in your module directory: Edit it to include the following dependencies to your project. © RapidValue Solutions 3
  • 4. How to Build an Android App for Document Collaboration with PDFTron SDK In your project's root directory, find the gradle.properties file. Copy the following line to it. Open your AndroidManifest.xml file and add a <metadata> tag inside the <application> tag to be a placeholder for the license key: © RapidValue Solutions 4
  • 5. How to Build an Android App for Document Collaboration with PDFTron SDK 3. Convert MS Office (Word, Excel, PowerPoint) to PDF To convert an MS Office file to a PDF document without any external third party dependencies. © RapidValue Solutions 5
  • 6. How to Build an Android App for Document Collaboration with PDFTron SDK 4. Preview PDF This section will show you how to open a document in a DocumentActivity. This is an AppCompatActivity which contains a PdfViewCtrlTabHostFragment and packages all the standard features used during document viewing The AndroidManifest.xml file needs to be updated to request permissions to allow DocumentActivity to function properly. You also need to add some attributes to the <application> tag as well as a new <activity> tag to define the DocumentActivity. © RapidValue Solutions 6
  • 7. How to Build an Android App for Document Collaboration with PDFTron SDK 5. Handling Incoming Annotation Data from the Server Authentication First, go to the Firebase console and click the "Authentication" button on the left panel and then click the "Sign-in Method" tab, just to the right of "Users". From this page click the "Anonymous" button and choose to enable anonymous login. © RapidValue Solutions 7
  • 8. How to Build an Android App for Document Collaboration with PDFTron SDK Annotation Data Flow After successfully authenticating the user and having obtained a user name, let's add the user to the Firebase database and start subscribing to database changes. © RapidValue Solutions 8
  • 9. How to Build an Android App for Document Collaboration with PDFTron SDK 6. Sending Client Annotation Data to the Server Next, let's add functionality to send client annotation changes to Firebase. PDFTron stores your annotations in XFDF -- the ISO Standard Format for annotations interchange -- which means your annotations can be preserved when sharing documents with people using other tools. Code is as follows: © RapidValue Solutions 9
  • 10. How to Build an Android App for Document Collaboration with PDFTron SDK 7. Add the Collaboration Viewer You can now connect your server to the PDFTron SDK's out-of-box collaboration UI, in your MainActivity.kt: © RapidValue Solutions 10
  • 11. How to Build an Android App for Document Collaboration with PDFTron SDK Customize a Document Viewer PDFTron includes DocumentActivity and PdfViewCtrlTabHostFragment for showing documents. To customize their appearance and function, see Customizing a document viewer. PDFTron also includes a low-level ViewGroup (PDFViewCtrl) to show documents. If you are using it, please see Customizing a PDFViewCtrl. New Document Viewer UI (Beta) Version 7.1.5 of PDFTron's Android PDF SDK release includes a brand new viewer PdfViewCtrlTabHostFragment2 which includes an updated user interface containing: improvements to the annotation toolbar, a better multi-tab navigation experience, improvements to stamp and signature flows, and more. Conclusion PDFTron SDK is an advanced framework for displaying and annotating PDFs on Android. It brings a new collaborative document viewing experience to Android, making use of PDFTron's powerful document viewing and editing features. PDFTron SDK is © RapidValue Solutions 11
  • 12. How to Build an Android App for Document Collaboration with PDFTron SDK very straight forward, the interface is very easy to understand and all the features it offers are simple. Using the PDFTron APIs and a server, you can set up real time collaboration easily. It lets the users collaborate on documents across all platforms: Web, Android, iOS, Windows & more. With PDFTron SDK, you can quickly provide document collaboration on 30+ file types in your application. PDFTron has a relatively stronger mobile platform when compared to the key competitors. If you’re an Android developer and looking forward to learn how to integrate PDFTron SDK in an Android Application, this article will help you how to do it right. Hope you find it as easy to use. Reference: https://www.pdftron.com/documentation/android/ © RapidValue Solutions 12
  • 13. How to Build an Android App for Document Collaboration with PDFTron SDK About RapidValue RapidValue is a global leader in digital product engineering solutions including mobility, omnichannel, IoT, AI, RPA and cloud to enterprises worldwide. RapidValue offers its digital services to the world’s top brands, Fortune 1000 companies and innovative emerging start-ups. With offices in the United States, the United Kingdom, Germany and India and operations spread across the Middle-East, Europe and Canada, RapidValue delivers enterprise services and solutions across various industry verticals. Disclaimer: This document contains information that is confidential and proprietary to RapidValue Solutions Inc. No part of it may be used, circulated, quoted, or reproduced for distribution outside RapidValue. If you are not the intended recipient of this report, you are hereby notified that the use, circulation, quoting, or reproducing of this report is strictly prohibited and may be unlawful. www.rapidvaluesolutions.com/blog +1 877.643.1850 contactus@rapidvaluesolutions.com www.rapidvaluesolutions.com © RapidValue Solutions 13