[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


>adding a [export to pdf] function to my web app bloats the size from 75kB to 3MB and requires a build step instead of just uploading the index.html to cloudfare
>>
>>109083057
@grok explain
>>
>>109083057
>adding a [export to pdf] function
you realize all OSes can export to PDF on the print screen, right?
>>
>>109083057
Build it once and use the output like it's a 3rd party lib.
Lazy load it from your app only when user uses the function.
No build step for your app, only for that specific lib.
No bloat, additional shit loads on demand.

If you can't figure this out, what the fuck are you doing in software dev? Let me guess, you use typescript, react and two dozen npm packages you never seen the source code of?
>>
>>109083468
i found a simpler solution.
the app just displays the file as a css formatted text file in the browser and the user just uses their browser's print to pdf function
and no, i specifically prompted claude to remove all bloat, and only use html, css, and plain ol' javascript in a single index.html file.
a complete web app, only 75kB in size, only a single file.
simple
minimalist
bloat-free.
>>
>>109083502
Can Android OS do "print to PDF", can iOS and iPadOS do that as well?
>>
>>109083502
>only 75kB in size
RESPECT+
>>
>>109083553
yes? chrome for android has a print to pdf function.
>>
>>109083614
Oh shit, I'd never know, don't use chrome.
>>
>>109083666
firefox has it too? i thought every browser has this feature
>>
Rewrite it in rust
>>
>>109083459
no, print screen just makes a jpg of it?
>>
>>109084226
No, you can print to PDF.
>>
File: 1753799019414787.png (184 KB, 483x470)
184 KB PNG
>>109083057
window.print();



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.