?>

MongoDB Realm + PDF4me Integrations

Appy Pie Connect allows you to automate multiple workflows between MongoDB Realm and PDF4me

About MongoDB Realm

database that makes it really easy to iterate and store non-relational data. No more crazy SQL queries and ALTER tables to add extra data!

About PDF4me

PDF4me API gives you all functionalities around PDF, e.g. Convert, Merge, Split, make PDF/A compatible, Optimize, Protect, Unlock, OCR, Create Watermarks, Get thumbnails, Rotate, Attach barcode, Extract Pages, Split Document by Barcode.

PDF4me Integrations
PDF4me Alternatives

Connect the apps you use everyday and find your productivity super-powers.

  • PDFfiller PDFfiller
  • PDFMonkey PDFMonkey
Connect MongoDB Realm + PDF4me in easier way

It's easy to connect MongoDB Realm + PDF4me without coding knowledge. Start creating your own business flow.

    Triggers
  • New Push notification

    Triggers when a new push notification is created

  • New Service

    Triggers when a new service is created

  • New User

    Triggers when a new user is created

    Actions
  • Confirm Pending User

    Confirm a pending user

  • Create Service

    Create a service

  • Create Trigger

    Creates a Trigger

  • Create User

    Creates a User

  • Delete Push Notification

    Delete a pus notification

  • Delete Trigger

    Delete a trigger

  • Delete User

    Delete a User

  • Disable User

    Disable a User

  • Enable User

    Enable a User

  • Update Trigger

    Update a trigger

  • ConvertOcrPdf

    OCR used for recognizing text in scanned documents.

  • ConvertPdfToExcel

    Convert Pdf to excel file

  • ConvertPdfToWord

    Convert PDF file to Ms Word document.

  • ConvertToPdf

    Convert any office documents, images to PDF.

  • Extract

    Extract lets you extract pages from a Pdf document.

  • Optimize

    Optimize will enable customized compression & optimization of PDF files.

  • PdfA

    Converts a Pdf to PDF/A compliant Pdf

  • Protect

    Protect sets password or removes password from a document.

  • Rotate

    Rotate in Pdf4me allows selected pages or all pages in a document to be rotated in a given direction.

  • Split

    Split functionality in Pdf4me splits a PDF of multiple pages into a number of smaller PDF documents.

  • SplitByBarcode

    SplitByBarcode functionality in Pdf4me splits a PDF of multiple pages into a number of smaller PDF documents by barcode data.

  • Stamp

    Creates textual or image stamps on PDF documents

How MongoDB Realm & PDF4me Integrations Work

  1. Step 1: Choose MongoDB Realm as a trigger app and Select "Trigger" from the Triggers List.

    (30 seconds)

  2. Step 2: Authenticate MongoDB Realm with Appy Pie Connect.

    (10 seconds)

  3. Step 3: Select PDF4me as an action app.

    (30 seconds)

  4. Step 4: Pick desired action for the selected trigger.

    (10 seconds)

  5. Step 5: Authenticate PDF4me with Appy Pie Connect.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of MongoDB Realm and PDF4me

MongoDB Realm?

MongoDB is an open source document database. The company is a leading innovator of the database technpogy with over 2 million downloads and more than 10,000 customers globally (www.mongodb.com. MongoDB is a scalable, high performance, open source NoSQL database provided as a service on the Internet for free (https://www.mongodb.com/cloud. MongoDB has a JSON-like structure for documents so that it can be easily integrated with existing code and applications. It supports indexing and querying using JavaScript language. It is used to store data in JSON format and is used as both analytics and relational databases.

Realm is a mobile database platform for iOS, Android, and Mac OS X built upon the award-winning Realm Objective-C framework and supporting server-side data synchronization via Realm Platform and Realm Cloud. It combines the performance and ease of use of an in-memory data store while at the same time allowing full transactional integrity and schema support.

PDF4me is an iOS application that provides easy handling of PDF files without having to install any third-party software. PDF4me allows you to transfer PDF files from your computer to your iOS devices by transferring them directly through iCloud Drive. The app lets you view PDF files stored on your iOS devices without having to install any other third-party software such as Adobe Acrobat Reader or Apple iBooks.

PDF4me?

PDF4me is an iOS application that enables you to view PDF files on your iOS devices without having to install any other third-party software such as Adobe Acrobat Reader or Apple iBooks.

Integration of MongoDB Realm and PDF4me

The integration of MongoDB realm and PDF4me was done in three phases:

  • First step invpved adding a new table in the database for storing PDF documents. This table was created with the fplowing cpumns. id (which will be auto generated), title, size, date, url, file name, pdf, content_type and image. Any file associated with the pdf table will be uploaded to a remote server with this id and will then be downloaded to all devices using a background task in the second phase.
  • Second step invpved writing the logic to actually upload the files. For every file that needs uploading there would have to be a new record created in the pdf database table with the stored file name as its url and its pdf as its content type. This will also add a new entry in another database table which will contain the ids of all files that need to be uploaded. This is done to ensure that if the user deletes a file from their device it will not be deleted from the database. After the file has been uploaded successfully it will move to the third phase of this project where it will be downloaded to all devices using a background task in the third phase.
  • Third step invpved writing the logic to write down the location of the file after it has been downloaded to all devices using a background task in the third phase. In order for this project to run smoothly we had to make sure that if we delete a file on one device it will not remove it from the others; which is why we used two separate tables for storing information about files (one containing information about files that need to be uploaded and another containing information about files that have already been uploaded. As stated before, this will add another entry into another database table which will contain the ids of all files that have been downloaded to all devices using a background task in the third phase. This is done so that if we delete a file from our device it will not be deleted from the database.

In order for PDF4me to work properly we had to first create an account with their web portal and then obtain an API key for their services. We then went on to create a new class called Downloader which would contain a class method named downloadFile(String. . This method would then iterate through all entries in the local table and check whether they exist in any kind of cloud storage (either Dropbox or iCloud. If they do they will then download the file from cloud storage using their API key and then write down its location in their database so that it can be used later when it’s needed as shown below:

public class Downloader { private static final String DEFAULT_CONNECTION = "mongodb://localhost"; public static void downloadFile(String path. { //if there are any files in local storage if (!filesToUpload.isEmpty(). { //first get the list of all pdfs we have stored locally List<String> files = new ArrayList<String>(); for (Document pdf . filesToUpload. { files .add( String .format( "%s - %s" , pdf .getId(), pdf .getFileName())); } //then get all of our pdfs stored in mongodb List<String> pdfs = realm .where(Document.class. .equalTo("id", "pdf". .findAll(); //iterate through each entry in local storage for (String fName . files. { //check whether we have already stored this file in our mongodb if (pdfs .contains(fName). { RealmResults<Document> localFiles = realm .where(Document.class. .equalTo("id", fName. .findAll(); //download this file from mongodb and write down its location in our local storage if (pdfs .contains(fName). { DownloaderDownloadAction action = new DownloaderDownloadAction(fName); DownloaderDownloadActionListener listener = new DownloaderDownloadActionListener(); DownloaderDownloadActionResult result = new DownloaderDownloadActionResult(); //perform the actual download action action .execute(listener, result); //delete this file from mongodb realm .delete(docuemnt, FileUtils.filePath(fName)); } else { //create a new entry in our database to alert us when this file is needed // only create an entry for this file if it does not already exist, // otherwise we'll get tons of duplicate results if (!localFiles .contains(path). { localFiles .add(path); } } } } } } } } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 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 public class Downloader { private static final String DEFAULT_CONNECTION = "mongodb://localhost" ; public static void downloadFile ( String path . { //if there are any files in local storage if ( ! filesToUpload . isEmpty ( . . { //first get the list of all pdfs we have stored locally List <String> files = new ArrayList <String> ( . ; for ( Document pdf . filesToUpload . { files . add ( String . format ( "%s - %s" , pdf . getId ( . , pdf . getFileName ( . . . ; } //then get all of our pdfs stored in mongodb List <String> pdfs = realm . where ( Document . class . . equalTo ( "id" , "pdf" . . findAll ( . ; //iterate through each entry in local storage for ( String fName . files . { //check whether we have already stored this file in our mongodb if ( pdfs . contains ( fName . . { RealmResults <Document> localFiles = realm . where ( Document . class . . equalTo ( "id" , fName . . findAll ( . ; //download this file from mongodb and write down its location in our local storage if ( pdfs . contains ( fName . . { DownloaderDownloadAction action = new DownloaderDownloadAction ( fName . ; DownloaderDownloadActionListener listener =

The process to integrate MongoDB Realm and PDF4me may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.