How I Used AI and TypeScript to Cut a 500-Page PDF Catalog into 4,000 Product Images

AI Export Lab · June 20, 2026

For one export website project, I needed to split a huge PDF catalog into thousands of clean product images. AI did not do it with one magic prompt. It helped me build and adjust a repeatable TypeScript workflow in PowerShell.

When building an export website, product images are not optional.

A buyer does not only want to read product text. They want to see the part, compare the shape, check the code, and understand whether the product is close to what they need.

For one catalog website project, the source material was a very large PDF catalog. The biggest catalog had more than 500 pages. Each page contained about 8 products. That meant more than 4,000 small product images hidden inside one PDF.

The job was not only to export pages as images. I needed to cut out every product image accurately, save each product as a separate file, and name the file according to the product code shown in the upper-left corner of that product block.

Doing that by hand would be painful.

So I used AI to help me build the workflow.


The Real Problem

The PDF looked simple at first: page after page of product blocks.

But the real task had several layers:

The important thing is that the catalog was structured. It was not random. Each page followed a pattern. That made automation possible.


The Tools I Used

My workflow used Claude, TypeScript, and PowerShell.

Claude helped me reason through the layout and write or adjust the TypeScript script. TypeScript handled the actual batch processing. PowerShell was where I ran the commands and checked the output folders.

This was not a no-code workflow. But as a non-programmer, I did not need to write the whole tool from scratch. I needed to explain the task clearly, test the result, and tell AI what was wrong.

That is a very different kind of work.


Step 1: Explain the Catalog Structure

I first described the catalog structure to AI.

I explained that the PDF had many pages, that each page contained multiple product blocks, and that each product image needed to be cropped separately. I also explained the naming rule: the file name should use the product code visible in the upper-left corner of each product block.

This step matters because AI cannot guess the business rule by itself. If I only said "cut this PDF into images," the output would not be reliable enough.

The useful prompt was not magic. It was specific:

This catalog has multiple product blocks per page. Each product block has a code in the upper-left corner. I need each product cropped as a separate image and saved with that code as the file name.

Once the task was clear, AI could help me turn the business requirement into a scriptable workflow.


Step 2: Test One Page First

I did not run all 500 pages first.

The safest method was to test one page.

I asked AI to help generate a TypeScript workflow that would take one page from the PDF and crop the product images from that page. Then I checked the output images manually.

This is where the real work happened.

If the crop was too large, I told AI. If the crop was too small, I told AI. If the left side had too much extra space, or the right side cut into the product area, I described the problem and asked it to adjust the crop coordinates.

The loop looked like this:

  1. Run the script on one PDF page.
  2. Open the output images.
  3. Check whether each product block was cropped cleanly.
  4. Tell AI what was wrong: too wide, too narrow, too high, too low.
  5. Adjust the script.
  6. Run the same page again.

Only after the single-page output looked right did I move to the full catalog.


Step 3: Run the Full Batch

After the one-page test passed, I used the same logic to run the remaining pages.

This is the part that felt different from manual work. Once the crop logic was correct, the script could repeat the same operation across hundreds of pages.

The catalog had more than 500 pages. With about 8 products per page, the final output was more than 4,000 product image files.

Each file needed to be named according to the product code shown in the catalog image. That naming step was important because random file names would make the images hard to connect to product pages later.

The output was not only a folder of pictures. It became a structured product image library.


Step 4: Add Watermarks in Batch

The most surprising part was watermarking.

After cutting thousands of product images, I also needed to add watermarks to the output images. I expected this to be slow or annoying.

But once the script was correct, the batch watermarking finished in only a few minutes.

That surprised me.

It is one thing to watch AI write text quickly. It is another thing to see thousands of image files processed in a real folder, one after another, without manually opening Photoshop or editing each image.

For me, that was one of the moments when AI-assisted work felt truly practical.


Why This Workflow Worked

The workflow worked because I did not ask AI to finish the whole job blindly.

I split the task into small checks:

This is the same lesson I keep learning from AI work: the tool can move fast, but the operator still needs checkpoints.


What I Would Not Automate Blindly

I would not trust this kind of workflow without checking samples.

If the catalog layout changes in the middle, the crop logic may fail. If the product code is unclear, the file name may be wrong. If the page has a special layout, the output may need manual review.

So the goal is not to pretend automation is perfect.

The goal is to reduce thousands of manual actions into a smaller number of review and correction steps.

That is already a huge improvement.


The Main Lesson

This job taught me something important about AI and small business work.

AI is not only useful for writing articles or answering questions. It can help turn a messy operational task into a repeatable workflow.

A 500-page PDF catalog with more than 4,000 product images sounds like a task for a team. But with AI, TypeScript, and PowerShell, the work became a process:

  1. describe the catalog structure
  2. write a first script
  3. test one page
  4. adjust the crop
  5. run the full batch
  6. add watermarks
  7. review the output

That is the real value of AI for a non-programmer: it does not remove judgment, but it gives you a way to build tools around real work.


Previous article — how I actually use Codex, Claude, and DeepSeek from China.
Follow the AI Export Lab — every public build note in this experiment.