-
-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request]: Use PDF as a template, similar to mail merge in word #177
Comments
I am adding my vote here as this is something that could be really handy to my use case ;) |
Hello @Misiu! This is an interesting idea. I can certainly see its utility. There is currently work being done by @cshenks to develop an AcroForms API (see here). When this is complete, it should be fairly straightforward to parse and modify the content of AcroForm text fields with @jtraulle @gustavodipietrodeus @DaveLo Since you've all expressed interest in this, I'd very much like to hear your thoughts as well. |
@Hopding , I'm interested in this functionality for use in variable data printing, at my company we send a customized instruction booklet to customers. Our current solution converts HTML to PDF , but we are reaching the point where development is constraining our design team since every change means a lengthy rebuild. Using this library there are places where I can easily put dynamic objects in blank areas (images, barcodes, etc), but other places where having string interpolation would be hugely helpful ( |
@Hopding AcroForms will be useful, but I support @DaveLo idea. I'd like to put placeholders in PDF and replace it with content. |
I think, like @DaveLo and @Misiu that AcroForms does not fulfill the same purpose as placeholder and placeholders will be more appropriate in my usecase (being able to search and replace on the client side some markers/placeholders that has been placed onto generated PDF during server side rendering of the PDF) 😉 |
Implementing this feature without using AcroForms presents three main challenges:
There are some shortcuts that could be taken if we placed some restrictions on the feature. For example, we could make (1) much easier if we required the placeholder text to be tagged with marked content operators (see section 14.6 MarkedContent of the PDF spec). But this would require the placeholders to be created in a special way, so it wouldn't be able to identify arbitrary strings of text like We could make (2) much easier as well, if we didn't try to automatically extract and reuse the font that the placeholders were drawn in. This step would be fairly straightforward if we required you to embed/provide your own font, just like you'd do for But as for (3), I'm not too sure what could be done to simplify this. I'm open to ideas though! I'm sure other PDF libraries (such as iText or PDFBox) support text extraction and replacement in some form/fashion. So it'd be interesting to see how they handle this part. |
@Hopding , I think restrictions make a ton of sense here. In general forcing tradeoffs for VDP style usage is reasonable, if the user needs full customization then drawing text on the page in an empty block is a better already available solution than variable interpolation.
|
Hi Guys is this feature still in the works? |
@kevin8479 This is not something I am actively working on. There are a number of other features that have much higher demand that I'd need to finish before turning to this. But as always, if any enterprising individual would like to try implementing this themselves, I'm happy to provide advise and answer questions! |
same issue. |
This issue is stale because it has been open 2 weeks with no activity. It will be closed in 2 days unless there is new activity. See MAINTAINERSHIP.md#issues for details. |
This is still a valid feature request. Maybe the state bot can leave alone the issues with the `feature-request label? |
Hey @Misiu 👋! I'm revamping how issues/discussions are handled on this repo (see MAINTAINERSHIP.md#issues for details). Going forward issues will only be kept open for long periods of time if they have a clear path to implementation or somebody is actively working on them (or they're high-impact bugs). This is definitely still a valid feature request, but it's been opened for 2 years now with no clear path forward. Since nobody is working on it (or likely to be anytime soon), I don't think it needs to be tracked as an open issue anymore. However, since there's been some good discussion in this thread, I've added it to #998 so it doesn't get totally buried. |
Closing this as its status is now being tracked on the roadmap. |
I'm looking for a client-side library that will allow me to create a preview of a document for a client.
Idea is to create a simple HTML form with couple of inputs and a preview button that will generate a pdf based on a template.
I'm aware that I can load an existing PDF and add an overlay to it (as shown in samples), but I'd like to replace text, for example, I'd like to replace
{{name}}
withJohn
and{{surname}}
withSmith
.I've searched over the issues and found #33 and #137, as I understand Your library doesn't support reading the text, so please consider this as a feature request.
With this one feature, Your library would be an ideal solution for client-side pdf manipulation.
The text was updated successfully, but these errors were encountered: