---
title: "Comment by Abhinav Kumar on \"PDF Generation At Scale\" | Hashnode"
description: "Very well written Ali Hussam ! I have some questions/suggestions about the image loading part and the architecture. Hope it will help. If the caller service has"
url: "https://hashnode.com/posts/pdf-generation-at-scale/646b66fe1cbe268787079722/comment/6558e4cf2a6c065f3be4d283"
---

[Discussion](https://hashnode.com/posts/pdf-generation-at-scale/646b66fe1cbe268787079722)

Comment [PDF Generation At Scale](https://hashnode.com/posts/pdf-generation-at-scale/646b66fe1cbe268787079722)

[Abhinav Kumar](https://hashnode.com/@abhinavk9757)

[Nov 18, 2023](https://hashnode.com/posts/pdf-generation-at-scale/646b66fe1cbe268787079722/comment/6558e4cf2a6c065f3be4d283)

Very well written [Ali Hussam](https://hashnode.com/@alihussam)! I have some questions/suggestions about the image loading part and the architecture. Hope it will help.

1.  If the caller service has to pass the image data then does it already have a puppeteer-like implementation that fetches webpages and then the image data?
    
2.  Generally the size of all the images combined is equivalent to the webpage size, Is there any reason why the entire webpage is sent as an event to another processor? Saving it into a blob and passing the address can be a better alternative.
    
3.  One can use node streams to write data into storage. Instead of converting the entire file to PDF, saving it to memory, and then storing it. Chunks of data can be converted and written into storage using (createPDFStream). With this, a large number of files can be associated for conversion and even a considerably smaller worker (with smaller mem and power) can process all the files
    

[Ali Hussam](https://hashnode.com/@alihussam)

[Jan 17, 2024](https://hashnode.com/posts/pdf-generation-at-scale/646b66fe1cbe268787079722/comment/6558e4cf2a6c065f3be4d283#reply-65a84fea8b334f98e190ffad)

Great insights.

1.  No puppeteer in caller function, caller fetch the images from Google Cloud Storage.
    
2.  As mentioned our requirements for image use is just a highly compressed logo (roughly 300KB as base64 string) and given there are some other business processes among the callers it made sense for us to pass it in event payload. As mentioned if your requirement is to use heavier media files it always better to pass a URL to media hosted in some CDN or storage.
    
3.  This is a great suggestion. It will increase the performance. 🙌
