Rosson Long
Rosson Long4w ago

Rosson Long - One of our experiences with Build...

One of our experiences with BuildShip that seems to be true so far is that you can't import common libraries like this: import { PDFDocument } from "pdf-lib"; Knowing that you can't import libraries like this, how would you build workflows that manage and interact with PDFs like for example, merging multiple PDFs together into a single PDF at the end of a workflow? Or maybe imports are possible. We just haven't had any success with them and we've been building for awhile.
11 Replies
Rosson Long
Rosson LongOP4w ago
@Gaurav Chadha
Gaurav Chadha
Gaurav Chadha4w ago
@Rosson Long named imports works in BuildShip, the only issue with import { PDFDocument } from "pdf-lib"; is that this particular library requires extra dependencies as worker which isn't working. you can use any other pdf parser libraries (which are browser supported), example, I used this for same operaton import pdf from '@cyber2024/pdf-parse-fixed'; and it worked flawlessly. https://app.buildship.com/remix/4318f78f-5105-4432-95ab-caf2aec89b7e
No description
Rosson Long
Rosson LongOP4w ago
Is there a good way to know whether or not an import has dependency workers without a basic trial-and-error approach? Thank you btw, this is a great starting point to solve the problem!!
Gaurav Chadha
Gaurav Chadha4w ago
The best approach is to build the node with the AI Builder, which will always use or update the node with the supported library. happy to help :)
Rosson Long
Rosson LongOP4w ago
Does this parser allow you to append 2 PDFs together? Or just copy content from one PDF and add it to another? We're looking to take a "Parent PDF" and append "Children PDFs" to it so that it's one giant PDF. @Gaurav Chadha
Gaurav Chadha
Gaurav Chadha4w ago
The current version copies and parses to another PDF. You can modify it to your usecase to take a "Parent PDF" and append "Children PDFs."
Rosson Long
Rosson LongOP4w ago
So you parse the PDF and then add the content that was parsed. Does this work for embedded images and signatures on the PDF? Or is this just parsing text?
Gaurav Chadha
Gaurav Chadha4w ago
you can give a try with embedded images pdf example, if it doesn't work then you can apply another parser
Rosson Long
Rosson LongOP4w ago
And the method you're using for finding other parsers is the Compass AI? It'll go hunt down a library that doesn't have additional workers embedded?
Gaurav Chadha
Gaurav Chadha4w ago
yes, use the modify wiht ai option
No description
Rosson Long
Rosson LongOP4w ago
We just got it working with the pdf-lib!!! We hit "fix with AI" when it failed and it patched it together.

Did you find this page helpful?