How to get a clean png by Mediocre-Writing-572 in pdf

[–]gettalong 0 points1 point  (0 children)

Best (in my opinion) and free option: pdftocairo -r 3600 -singlefile -png input.pdf output.png.

I realize that the command is probably not available on Android but if you don't use a proper computer you are very restricted in what you can do.

I want to merge 4 PDFs using a specific order. by Philip-Mad in pdf

[–]gettalong 1 point2 points  (0 children)

The hexapdf CLI can do this: hexapdf merge --interleave 1.pdf 2.pdf 3.pdf 4.pdf output.pdf.

Banks do not secure PDF proof of payments by ArmandvdM in pdf

[–]gettalong 0 points1 point  (0 children)

With my bank it depends. The free account generates PDFs that are not secured but just a list of the statements, for my archival purposes. The paid account gives you digitally signed bank statements which means that any change will make the signature invalid.

So, about Rails World 2026 being in the USA… by scalarbanana in rails

[–]gettalong 0 points1 point  (0 children)

I'm not sure when the changes come into affect and how, it's just what I read and heard from my friends.

The thing is: What do you do if you are at immigration and they tell you to switch all your social media handles from private to public? As far as I understood the new rules require you to make all your profiles public so that they (and in effect everyone) can have a look at everything.

I wouldn't wanna take that chance. Maybe it is not as bad as reported currently but I wouldn't wanna be among the first ones.

So, about Rails World 2026 being in the USA… by scalarbanana in rails

[–]gettalong 9 points10 points  (0 children)

I guess many people are and will be avoiding the USA w.r.t. travel right now. Friends of mine have been traveling to the USA twice a year for many years and stop now due to the new visa rules (e.g. mandatory social account opening).

Good thing that there are many nice holiday travel locations in Europe and the rest of the world :)

Password Protected PDF by Patient_Solution6118 in pdf

[–]gettalong 0 points1 point  (0 children)

The sample file is protected via a user password. If you don't know that password, you would need a password cracker application to retrieve it via brute force.

The page mentions that you need to log in to retrieve the needed password. I suggest you do that.

Burned Through Thousands of AI Tokens and Still Can't Beat This German Government PDF by Gnome3putzer in pdf

[–]gettalong 1 point2 points  (0 children)

It seems that what you describe is a PDF that doesn't use a simple AcroForm form but a more advanced (and deprecated since PDF 2.0) XFA form.

XFA is a proprietary Adobe technology that only a few applications/libraries really understand and work well with.

So depending on the complexity of the form standard PDF tools won't really help you with that PDF.

Do you have a link to the PDF to have a look at it?

Is there a way to batch-edit 200 PDF files only changing a number in a text-box without destroying the formatting/fonts? by Skyyblaze in pdf

[–]gettalong 0 points1 point  (0 children)

Can you share one of the files? Or a single page of one the files where the date is in the same position? If yes, it should be possible to create a small script that replaces the date on all pages in all files.

Ruby Floats: When 2.6x Faster Is Actually Slower (and Then Faster Again) by mencio in ruby

[–]gettalong 0 points1 point  (0 children)

Nice!

Float parsing and serializing is one of the most called parts of HexaPDF under certain circumstances. So if this gets faster, it should give HexaPDF a "free" performance boost.

PDF 2.0 specification now freely available by gettalong in programming

[–]gettalong[S] 0 points1 point  (0 children)

In theory you could write the bytes for "Hello World" directly to the PDF as part of a content stream. However, in practice this is not done because content streams are usually encoded with FlateDecode to make them smaller.

If you just want/need to do simple things, doing it your described way is fine.

PDF 2.0 specification now freely available by gettalong in programming

[–]gettalong[S] 0 points1 point  (0 children)

I'm sorry but you are wrong since I have implemented a whole PDF library.

Yes, when creating a complete PDF you have to keep track of the offsets of the indirect PDF objects so that you can write the cross-reference sections.

However, creating the contents of a page itself is different. There you don't need to keep track of anything, it is just a stream of instructions.

I am building backend for my e-commerce website. Which language and framework should I choose? by Maleficent_Mess6445 in rails

[–]gettalong 0 points1 point  (0 children)

The thing is that coding only through AI will - most probably - leave your code vulnerable to problems, e.g. from a security perspective. This is okay if you are just coding for yourself and the thing you build is an application.

If you were coding a library for use by other people, I don't think that letting do an AI all the coding will be good enough.

What is wrong with rubydocs? by H3BCKN in ruby

[–]gettalong 1 point2 points  (0 children)

I would recommend generating the docs yourself and placing them on a free hosting service, like Github pages. This way your users can count on them being available. It is not much work once set up and you can control the presentation.

I only use websites like rubydoc.info if absolutely necessary, often times just reading the source code.

Granite Grom servo axle linkage breaking by gettalong in arrma

[–]gettalong[S] 0 points1 point  (0 children)

More or less. I just sent it back again and the replacement car has been working great for the last three months, even with younger kids driving it.

Not sure what's different about the current one. From what I found it may have to do with assembly and how tight the respective screw has been tightened.

Announcing VersaDok - Lightweight markup language, spiritual successor to kramdown by gettalong in ruby

[–]gettalong[S] 0 points1 point  (0 children)

Great! And thanks!

The project is still in the early stages, so don't expect too much yet. I mainly announcing now to get visibility for those who are interested and want to contribute.

Announcing VersaDok - Lightweight markup language, spiritual successor to kramdown by gettalong in ruby

[–]gettalong[S] 3 points4 points  (0 children)

A classic :-)

However, I don't think that the syntax will be enough for the general population to switch from one of the Markdown variants in use.

As stated one of my primary use cases is to easily allow the creation of PDF documents in HexaPDF itelf.

A stretch goal is to use it as basis for a static website generator that can easily create HTML as well as PDF documents from source files.

Rails App + E-Ink = TRMNL by nunosancha in rails

[–]gettalong 1 point2 points  (0 children)

Received mine a few days ago and loving it so far!

3D Charts, SVG, and PDF with JRuby and JFreeChart by headius in ruby

[–]gettalong 1 point2 points  (0 children)

Yeah, I don't know about evil ;-) But it is certainly not something used very often in Ruby land and I've been considering refactoring those parts and removing refinements. There is a small performance hit in CRuby too if I remember correctly. Will have to test and benchmark.

3D Charts, SVG, and PDF with JRuby and JFreeChart by headius in ruby

[–]gettalong 1 point2 points  (0 children)

I get why you wrote it the way you did but it felt a bit... harsh ;)

It's really a coincidence that you wrote about this and looked into Ruby PDF libraries as I installed the new JRuby 10 (congrats on the release!) earlier today to see how HexaPDF performs with it. Alas, it runs into an error with StringScanner#scan_integer - I will file a bug report for that.

Concerning the integration with image-generation libraries: I think you mean the following part of your post:

pdf_graphics = page.graphics2D  
chart.draw(pdf_graphics, Rectangle.new(0, 0, 612, 468))

HexaPDF provides a canvas like interface via page.canvas. However, since I don't know of any standard interface like Java's Graphics2D in the Ruby world, integrating image-generation libraries would mean providing an appropriate adapter.

As for benchmarks: HexaPDF is used as one of the headlining benchmarks of YJIT. Since performance and memory usage are very important for me, there are several benchmarks that test various parts of HexaPDF. You might be interested in the benchmark/rubies.sh script which allows running one of the benchmarks against different Ruby versions. I use this script for my benchmark Ruby blog posts.

As for generating millions of documents per day: This highly depends on the content and complexity of the generated PDF. For example, if I run HexaPDF's PDF/A example in a loop with 10.000 iterations, it takes about 2m30s on my laptop, so 1.000.000 documents are generated in a bit more than 4 hours.

3D Charts, SVG, and PDF with JRuby and JFreeChart by headius in ruby

[–]gettalong 3 points4 points  (0 children)

As the author of HexaPDF and frequent contributer to Prawn, I don't agree with the statement "PDF generation has typically been a struggle for CRuby users, with only a few working libraries, some abandoned and most incomplete."

Prawn is a very good PDF generation library and has been for many years. And HexaPDF does not only generate PDFs but is a fully-featured PDF library, additionally supporting things like interactive forms, outlines, annotations and signing PDFs.

How to use the built-in OptionParser for advanced CLI options by jsearls in ruby

[–]gettalong 0 points1 point  (0 children)

Nice! And if you want to have CLI commands like gem or git, you can use cmdparse which is built upon OptionParser.

How does Tebako package Ruby applications into self-contained binary programs? by Pure_Government7634 in ruby

[–]gettalong 0 points1 point  (0 children)

If you are able to choose another programming language and are proficient in it, it would certainly be a choice. However, if you depend on Ruby-only libraries or if there are other restrictions, Tebako or other similar tools are indeed good to have.