• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to generate a PDF dynamically, having sections built on runtime?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have to create a PDF with details of an employee's family, and it has to be decided on runtime how many sections for dependents' information will be added. I am using i-text but the problem is coming while the decision making of adding sections for family members. Any ideas on how to do it?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is "the problem"?
 
Shalinee Gupta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem is.. I have a template, with sections: 'Employee Info', 'Spouse Info', 'Dependent1 Info', 'Dependent2 Info' etc
I need to add spouse and dependents in the final PDF only if their values are present, in case the employee does not have a family member, I don't want his section to be displayed with blank fields.
Since, I have to use existing template, so I am not creating the PDF manually (by adding paragraphs and sections). How to achieve this scenario?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have to use existing template


This is important information. What kind of template are we talking about? Is it a pre-existing PDF in which your code is supposed to fill in values, or something else? How does the template relate to the process of creating the PDF?
 
Shalinee Gupta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, it is a pre-existing pdf template in which values will be filled using a map.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not aware of a way to add or remove sections of a PDF. You could reorganize the sections as a series of one-page PDFs, and add only those that you need to the final PDF.
 
Shalinee Gupta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply Ulf. I was given the requirement in a different way to solve the problem, now I am not working on manipulating sections of an exiting PDF template, but working with fixed template pages and using xml configuration to select required pages on run time.
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic