java - How to add a row in a itext PdfPTable dynamically? -




i have create pdf using itext contain button, when clicked should add row in existing pdfptable. wrote code create pushbuttonfield. while trying set action can find pdfaction.javascript. not able figure out how add row in table. tried searching online find pdfaction.javascript

any appreciated. thank you.

when create pdf file, draw text, lines , shapes canvas. happens when add pdfptable document. if @ syntax of pdf page, won't recognize table. you'll find text (the content of cells), lines (the borders), , shapes (the backgrounds), won't find table. if table distributed on different pages, "table" on 1 page won't know related "table" on other page.

sure, can add semantic structure document introducing marked content, , creating structure tree, mechanism call tagged pdf can't used make pdf "editable" same way word document editable. tagged pdf (among others) used allow assistive technology present content visually impaired (e.g. in context of pdf/ua). presence of structure doesn't change fact text, lines, , shapes added @ absolute positions.

this different html position on page of <table>, <tr>, <th>, or <td> calculated @ moment page rendered. in html position can change when resize browser window.

there no such thing in pdf (except if use xfa (*), technology deprecated since iso 32000-2). content on page has fixed position, hardcoded page's content stream. changing size of pdf viewer window won't change position of page content.

because of of this, question invalid. impossible create button in pdf adds row table, because:

  1. in many cases there no table: there bunch of text, lines, , shapes @ absolute positions,
  2. even if there notion of table (using tagged pdf): visual represenation of table fixed @ creation time, can't changed @ consumption time.

you want use ordinary pdf viewer if pdf editor. impossible reasons listed above.

(*) xfa deprecated different reasons. 1 of important reasons lack of support xfa. there aren't many viewers support xfa. if post follow-up question asking *"how can create xfa document?", answer be: "don't this!" creating xfa extremely complex, , once you've succeeded in creating xfa form, you'll discover many of customers won't able consume file because viewer doesn't support format.





wiki

Comments

Popular posts from this blog

elasticsearch - what is the equivalent data type for geo_point in hibernate search? -

firebase - How to wait value in Ionic 2 -

Jenkins: find build number for git commit -