Increase table row height in existing pdf

Raj

I would like to modify the height of a table row in an existing pdf document. I would like the content below the table to be automatically moved down when the row height is increased. I have tried with hummuspdf, but there doesn't seem to be en explicit way to do this. Is there a way to accomplish my requirement programatically?

Samuel Huylebroeck

I would like to modify the height of a table row in an existing PDF document.

You're not going to like the answer to this: It's technically possible, but a lot harder than you think it is.

There's 2 major roadblocks here: 1) PDF is not designed to be an editable format. 2) A PDF document has no concept of a table.

To expand on 2), a PDF in essence contains a series of drawing and text instructions referencing absolute positions. A table is nothing more than a set of text instructions and line drawing instructions that happen to visually represent a table.

These instructions don't even have to be close to each other in the file. It's entirely possible the line strokes for the borders are found at the top of the file and all but one text instruction near the end of the file, with a final instruction lazing around somewhere in the middle.

Unless structure has been explicitly added during creation (see Tagged PDFs), there's no guarantee you programmatically identify the set of instructions that visually resemble a table to you.

Now, suppose you are in luck and you have managed to do just that, and you now you want to increase table height, and probably have the rest of the contents adapt to the new height. Now 1) comes into play. Because PDF instructions reference absolute coordinates, you have to recalculate everything that would be affected: the lines that make up the borders, text inside the table, all contents below the table etc..

And remember, all contents below the table in the document aren't necessarily below the table instructions in the file.

If you do succeed at all this, I imagine a lot of people would be very interested in your solution.

tl;dr:

There's a reason why this seemingly trivial functionality is not present in commonly used PDF libraries, and that's because the PDF format makes it a hard problem.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Adding a row to an existing table

From Dev

Update table row and increase row data with + 1

From Dev

Unable to set row height equal to table height

From Dev

Reducing HTML Table Row Height

From Dev

Auto height of table-row

From Dev

Change table row height - Bootstrap

From Dev

Table with dynamic row height issue

From Dev

Active Reports Table Row Height

From Dev

Table with dynamic row height issue

From Dev

Table with variable row height in tkinter

From Dev

Add single row in a existing table

From Dev

UITableView deleting row reduced table row height

From Dev

Why does table-caption increase the height of the table?

From Dev

dynamically increase row size of HTML table in javascript

From Dev

Increase the main tableview row height according to the custom cell

From Dev

Set cell height in PDF table created with itextsharp

From Dev

Adding table to existing PDF on the same page - ITEXT

From Dev

generate a hyperlinked table of contents and insert into existing PDF

From Dev

generate a hyperlinked table of contents and insert into existing PDF

From Dev

how to restrict html table row height in WebGrid

From Dev

TCPDF - Is there a way to adjust single table row height?

From Dev

Overflow for div with 100% height inside of table row

From Dev

CSS Table set max row height

From Dev

In HTML Table: How To Manage Tables Row Height?

From Dev

Responsive height div cells in table with row span

From Dev

TCPDF - Is there a way to adjust single table row height?

From Dev

Inbox Table Like Gmail - Fixed Row Height

From Dev

Add row to existing table in webbrowser object

From Dev

delete existing row from data table

Related Related

HotTag

Archive