PDF.co API for Word to PDF Conversion and Parsing

PDF.co API for Word to PDF Conversion and Parsing

Hello,

I am posting this topic here because the developer community has been so helpful in the past. We have been attempting to work with PDF.co to get an answer on some issues we're having, but there must be a time zone delay, and there's just been a lot of back and forth, rather than an actual resolution. Here is what we're attempting to do:
  1. Download a .docx file from a custom module's attachments
  2. Obtain a pre-signed URL from PDF.co (they're using AWS) to work with the file
    1. URL response - url to access uploaded file
    2. Presigned URL - used to upload local file
  3. Upload the .docx file to AWS with the pre-signed URL
  4. Convert the .docx file to a PDF using the PDF.co endpoint and the URL obtained from the pre-signed URL upload
  5. Parse the PDF and return as JSON to our deluge custom function
  6. We then iterate through it and do the things we need to do
A couple more notes before we get into the code:
  1. We tried to convert the .docx file to a PDF using the Zoho Writer API and found that cell borders disappeared causing issues with the parsing at PDF.co. BUT, everything else worked great, including uploading the PDF to the pre-signed URL.
  2. We attempted to upload the file to PDF.co's built in storage, rather than the pre-signed URL, but when we download the file, and then attempt to pass it as a parameter, we get an error saying the file parameter is missing. We believe this is because the upload endpoint wants the file path. We don't know how to get that or if we even can get that from Zoho. 
  3. The pre-signed URL endpoint worked for us when we uploaded the Zoho converted PDF file.
Okay, on to the code. Thanks in advance for your help and grace with this far from perfect code! I have omitted the parsing code since we're getting hung up before then.
  1. thisRec = zoho.crm.getRecordById("Meeting_Details",thisRecId);
  2. accountId = thisRec.get("Account").get("id");
  3. newList = List();
  4. //Get all attachments on meeting detail rec
  5. response = invokeurl
  6. [
  7. url :"https://www.zohoapis.com/crm/v6/Meeting_Details/" + thisRecId + "/Attachments?fields=id,Owner,File_Name,Created_Time,Parent_Id&sort_order=desc&sort_by=Created_Time"
  8. type :GET
  9. connection:"******"
  10. ];
  11. // info response;
  12. responseNull = response.isNull();
  13. info "Attachment Response Empty: " + responseNull;
  14. if(responseNull == true)
  15. {
  16. info "No Attachments to parse";
  17. return;
  18. }
  19. //Get last uploaded file
  20. fileRec = response.get("data").get(0);
  21. info "File Rec: " + fileRec;
  22. fileId = fileRec.get("id");
  23. info "File ID: " + fileId;
  24. fileName = fileRec.get("File_Name");
  25. info "File Name: " + fileName;
  26. createdTime = fileRec.get("Created_Time");
  27. info "Created Time: " + createdTime;
  28. //Download File from Meeting Detail Rec
  29. downloadResponse = invokeurl
  30. [
  31. url :"https://www.zohoapis.com/crm/v6/Meeting_Details/" + thisRecId + "/Attachments/" + fileId
  32. type :GET
  33. connection:"******"
  34. ];
  35. info downloadResponse;
  36. fileCheck = downloadResponse.isFile();
  37. info "File? " + fileCheck;
  38. //
  39. //PDF.co Headers
  40. apiKey = "*******************";
  41. headers = Map();
  42. headers = {"x-api-key":apiKey};
  43. // Upload Permission
  44. setupFileUpload = invokeurl
  45. [
  46. url :"https://api.pdf.co/v1/file/upload/get-presigned-url?name=" + fileName + "&encrypt=false"
  47. type :GET
  48. headers:headers
  49. detailed:true
  50. ];
  51. setupFileUpload = setupFileUpload.get("responseText");
  52. // info "File Upload Response: " + setupFileUpload;
  53. uploadUrl = setupFileUpload.get("presignedUrl");
  54. info "Upload URL: " + uploadUrl;
  55. workingFileUrl = setupFileUpload.get("url");
  56. info "Working URL: " + workingFileUrl;
  57. // Actual Upload
  58. uploadHeaders = Map();
  59. uploadHeaders.put("x-api-key",apiKey);
  60. uploadHeaders.put("Content-Type","application/octet-stream");
  61. uploadParams = Map();
  62. uploadParams.put("file",downloadResponse);
  63. uploadParams.put("expiration",20);
  64. uploadParams.put("async","true");
  65. actualUpload = invokeurl
  66. [
  67. url :uploadUrl
  68. type :PUT
  69. parameters:uploadParams
  70. headers:uploadHeaders
  71. detailed:true
  72. ];
  73. info "Actual Upload: " + actualUpload;
  74. //
  75. //Convert to PDF
  76. conversionURL = "https://api.pdf.co/v1/pdf/convert/from/doc";
  77. conversionHeader = Map();
  78. conversionHeader.put("x-api-key",apiKey);
  79. conversionHeader.put("Content-Type","application/json");
  80. conversionPayload = {"url":workingFileUrl,"async":false,"inline":"true","password":"","profiles":""};
  81. conversionResult = invokeurl
  82. [
  83. url :conversionURL
  84. type :POST
  85. parameters:conversionPayload
  86. headers:conversionHeader
  87. detailed:true
  88. ];
  89. info "Conversion Result: " + conversionResult;
  90. convertedDocURL = conversionResult.get("responseText").get("url");
  91. info "Converted Doc URL: " + convertedDocURL;
We believe the issue is happening on the upload to the pre-signed URL. Once we upload the file 66-74, we then use the workingFileURL to look at the document. We are able to download, but have to use Word's recovery tool as it's corrupted. The code continues and it converts the file to a PDF, but it is unintelligible. 

Thanks so much for your help!
    • Sticky Posts

    • Function #46: Auto-Calculate Sales Margin on a Quote

      Welcome back everyone! Last week's function was about displaying the discount amount in words. This week, it's going to be about automatically calculating the sales margin for a particular quote, sales order or an invoice. Business scenario Where there is sales, there's also evaluation and competition between sales reps. A healthy rivalry helps to better motivate your employees to do smart work and close deals faster and more efficiently. But how does a sales rep get evaluated? 90% of the time, it's
    • Zoho CRM Functions 53: Automatically name your Deals during lead conversion.

      Welcome back everyone! Last week's function was about automatically updating the recent Event date in the Accounts module. This week, it's going to be about automatically giving a custom Deal name whenever a lead is converted. Business scenario Deals are the most important records in CRM. After successful prospecting, the sales cycle is followed by deal creation, follow-up, and its subsequent closure. Being a critical function of your sales cycle, it's good to follow certain best practices. One such
    • User Tips: Auto-Create Opportunity/Deal upon Quote Save (PART 1)

      Problem: We use quotes which convert to sales orders but Users / Sales Reps do not create opportunities / deals and go straight to creating a quote. This leads to poor reporting. Implementing this solution improves reporting and makes it easier for users.
    • Custom Function : Automatically send the Quote to the related contact

      Scenario: Automatically send the Quote to the related contact.  We create Quotes for customers regularly and when we want to send the quote to the customer, we have to send it manually. We can automate this, using Custom Functions. Based on a criteria, you can trigger a workflow rule and the custom function associated to the rule and automatically send the quote to customer through an email. Please note that the quote will be sent as an inline email content and not as a PDF attachment. Please follow
    • Function #50: Schedule Calls to records

      Welcome back everyone! Last week's function was about changing ownership of multiple records concurrently. This week, it's going to be about scheduling calls for records in various modules. Business scenario Calls are an integral part of most sales routines.. Sales, Management, Support, all the branches of the business structure would work in cohesion only through calls. You could say they are akin to engine oil, which is required by the engine to make all of it's components function perfectly. CRM
    • Recent Topics

    • Introducing Withdrawal Reasons for Offers

      We’re excited to introduce a new enhancement to the Offer module that brings more clarity and accountability to every withdrawn offer. The Withdrawal Reason update ensures that each withdrawal — manual or automatic — is backed by a clear explanation,
    • Zoho Creator customer portal users

      Hi, I'm in a Zoho One subscription with our company. I'm running a project now that involves creating a Zoho Creater application and using the Zoho Creator Customer Portal.  At most we need 25 customer portal users. In our Zoho One plan we only get 3
    • GPS tracking only or Check out facility

      Dear Team, Zoho CRM is quite robust CRM but till date i was waiting for the feature of having GPS tracking of Sales employees which is a common demand by all customers for thier field sales executives. We cover them by saying that CRM provides Checkin
    • Appraisals on Employee Information Profile

      Is it possible to show completed appraisals on each employee's "Employee Information" page? I would presume at the bottom - similar to the "Related Lists" concept in Zoho CRM. Obviously view access would be limited to employee and appropriate other roles
    • AI Interview Insights: Turn Recorded Interviews into Quick Transcripts & Summaries

      Evaluating interviews shouldn’t require replaying long recordings or taking manual notes. With AI Interview Insights, you can now review complete transcripts and AI-generated summaries of your One-way (Recorded) interviews right inside Zoho Recruit. This
    • Kaizen #220: Actions API - Webhooks APIs - Part 2

      Hello all!! Welcome back to the follow-up Kaizen post of Kaizen #219: Actions API - Webhooks APIs - Part 1. In the previous week, we covered how to configure a basic Webhook and how to include Headers, Body, and URL Parameters using both the POST Webhook
    • Standard Payment Term is not pulled from account to quotation

      Hey Team There seems to be something off. I do have "Net 30" as my default payment term in Zoho Books for my customers. If, from the customer overview or quote section, I create a new Quotation, the payment terms field stays blank and doesn't get the
    • Manage your invoices from Bigin's mobile app (iOS)

      Hello everyone! We're happy to announce that users can now integrate Zoho Books with the latest version of Bigin's iOS app. Zoho Books can be integrated with Bigin only via the web application. Users can view the Zoho Books tab in the detail pages of
    • Systematic SPF alignment issues with Zoho subdomains

      Analysis Period: August 19 - September 1, 2025 PROBLEM SUMMARY Multiple Zoho services are causing systematic SPF authentication failures in DMARC reports from major email providers (Google, Microsoft, Zoho). While emails are successfully delivered due
    • Accessibility controls and multilingual captcha authorization for Help Center users ​

      Hello everyone, As part of our ongoing effort to improve user experience, we are excited about the accessibility controls and predefined accessibility personas added in the Help Center, similar to what is already available in Zoho Desk. Help Center users
    • Zoho Sign + Zoho CRM : la solution pour simplifier vos accords de vente

      La conclusion d’un contrat de vente nécessite de nombreuses étapes : préparation de documents, validations successives et collecte des signatures. Les équipes commerciales passent souvent par plusieurs cycles de collaboration et de révision, tout en assurant
    • Zoho Desk Limitations

      Good day, all, I would like to know whether others share my frustration with some of Zoho's limitations. Don't get me wrong, I like Desk (and I also have a subscription for Analytics), I have been with them for close to 10 years, and unfortunately, I
    • Item/service subtotal

      Just discovered & really pleased that we can drag to re-order the line items in Sales orders & Invoices, a very nice feature which doesn't seem to be documented? It would be nice to be able to insert a subtotal as a line item to complete this great feature
    • how to Solve Conflict Invoices in Zoho POS

      Hello Team, I am facing a repeated issue in Zoho POS while saving a sale that contains service-based items. My products are intentionally created as Service (Non-Inventory) items because I do not want to track stock for them. However, every time I try
    • Copy, Paste, Highlighted text

      when i copy paste text it gets highlighted. Fix this.  WTF is with this black highlight ? Fix copy pasting. Some people pay for using this mail service. 
    • Pricing Strategies: #6 Common Mistakes while Configuring Pricing

      "Why does this month's billing feel messy again?" That was the exact line Priya muttered while staring at the spreadsheet full of edited pricing, one-off discounts and mismatched subscription details. Her business was growing, but the pricing machine
    • Publish to LinkedIn via API

      Hi, Is it possible to publish a job opening to LinkedIn (paid job slots) if creating a job opening via api / deluge function? Or is the user required to manually publish via the job boards process? Many Thanks Adrian
    • FSM - Associating and selecting Contacts based on Service Addresses

      Hi FSM team, I've come across an FSM limitation I wanted to share for improvement. I'm currently configuring FSM for a client who provides heating system install and maintenance services. The are often sub contracted by building management companies to
    • Do Unpublished Products in Shopify Sync to Zoho POS?

      Will an unpublished product in Shopify sync to Zoho POS? I would like to know how Zoho POS handles products that are in draft/unpublished status in Shopify.
    • Problem in Zoho POS frontend ERP.

      We are facing some difficulties in our billing and inventory processes and require your support to resolve them at the earliest. Customer Advance Payments We receive advance payments from customers for upcoming sales. Please guide us on how to record
    • How to create estimates/Invoices with sub-totals

      Every other accounting package can create estimates and invoices with Sub-totals. How can I do that in ZohoBooks?
    • Categorize Items with Item Headers

      Hello customers, Did you ever want to classify items based on specific categories to help your customers understand your invoice better? With the new Item Header feature, you can easily categorize items in your invoices and estimates and give them a common title.  Item Headers are available in the Invoices, the Recurring Invoices and the Estimates module. It can be carried forward from estimates to invoices at the time of converting the estimates.  To add an item header: Go to the Estimates, Invoices
    • Emails sent through Bigin are not posting in IMAP Sent folder

      I have set up my email to work from within Bigin using IMAP.  I am using IMAP so I can sync my email across multiple devices - phone / laptop / desktop / iPad / etc.  I want all my emails to populate my email client (outlook & iphone email) whether or
    • Painfully Slow Zoho mail

      Since yesterday Zoho Mail seems to have starting functioning very slowly and having a few bugs. It's slow to open mails, slow to send, slow to change between email accounts. Sometimes clicking on a particular folder (eg Sent folder) stops working and
    • Discount on the transaction level in POS

      "Is it possible to apply a discount on the total bill before tax in Zoho POS?" I want to apply a discount on the total transaction amount in Zoho POS, but the discount should be calculated before the taxes are applied. Is there an option to do this in
    • Create Tasklist with Tasklist Template using API v3

      In the old API, we could mention the parameter 'task_template_id' when creating a tasklist via API to apply a tasklist template: https://www.zoho.com/projects/help/rest-api/tasklists-api.html#create-tasklist In API v3 there does not seem to be a way to
    • Send Automated WhatsApp Messages and Leverage the Improved WhatsApp Templates

      Greetings, I hope all of you are doing well. We're excited to announce a major upgrade to Bigin's WhatsApp integration that brings more flexibility, interactivity, and automation to your customer messaging. WhatsApp message automation You can now use
    • Jobs at multiple locations

      Hi A lot of times we have same job open at multiple locations. So I would like an option where we can create a job and choose multiple locations. Currently we have to create individual jobs for each location. If we can create one job and mention multiple
    • From Zoho CRM to Paper : Design & Print Data Directly using Canvas Print View

      Hello Everyone, We are excited to announce a new addition to your Canvas in Zoho CRM - Print View. Canvas print view helps you transform your custom CRM layouts into print-ready documents, so you can bring your digital data to the physical world with
    • Passing the CRM

      Hi, I am hoping someone can help. I have a zoho form that has a CRM lookup field. I was hoping to send this to my publicly to clients via a text message and the form then attaches the signed form back to the custom module. This work absolutely fine when
    • Tag Adding Option in Kanban Card Customization Bigin CRM Mobile App

      I would like to request an option to add and display tags on Kanban cards in the Bigin CRM mobile app. This feature would make it easier to categorize deals and quickly identify priorities while working on the go.
    • Empowered Custom Views: Cross-Module Criteria Now Supported in Zoho CRM

      Hello everyone, We’re excited to introduce cross-module criteria support in custom views! Custom views provide personalized perspectives on your data and that you can save for future use. You can share these views with all users or specific individuals
    • WhatsApp Voice Message Sending Option in Bigin CRM

      I would like to request a feature that allows users to send WhatsApp voice messages directly from Bigin CRM. This would help improve communication efficiency and make it easier for teams to respond quickly to customer inquiries.
    • CRM: hosting a single html file in Zoho and displaying it as a widget

      I have seen that CRM offers the option of uploading a web project to Zoho itself and displaying it as a widget in CRM. The instructions then talk about setting a development environment with Node and developing an application to upload to Zoho. But I
    • How to change position button transtition of Blueprint?

      Hi Everyone, Look at my screenshoot, it is possible move the reject button to the right? I couldn't find that setting in the blueprint. Thank you.
    • Multi file upload

      Hi, I just wonder if one could upload multiple files in one shot, say between one and three files, without adding multiple File Upload fields? Thanks, Alalbany
    • Sorting Descending in a lookup

      I have a case number lookup on multiple forms. I need the most recent added to appear at the top of the lookup or as the list of cases grom it's too much to scroll. Is there a way to have a look up sort descending?
    • Importing customer comments and multiple shipto addresses

      I am evaluating Zoho Books and have most of my data imported with two exceptions: (1) Import customer comments - in my current system I have several comments of different types, and I need to bring these into Zoho. Preferably Books customer records, but
    • Auto-upload Creator Files to WorkDrive

      Hi everyone, I’m working on a workflow that uploads files from Zoho Creator to specific subfolders in Zoho WorkDrive, as illustrated in the attached diagram. My Creator application form has two multi-file upload fields, and I want—on successful form submission—to
    • Asap Widget 2.0

      Where's the documentation for the new ASAP widget? https://www.zoho.com/desk/developers/asap/#introduction this one is outdated How can we dynamically navigate between different views? How can we prefill ticket forms using ASAP 2.0?
    • Next Page