• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Eingabefelder (Input Felder) einer vorhandenen PDF durch Javascript (auf Webseite) ändern

New Here ,
Nov 01, 2020 Nov 01, 2020

Copy link to clipboard

Copied

Hallo liebe Community

 

ich stehe vor einem Problem welches ich zu lösen versuche und ich bis dato keine für mich relevanten Lösungen im Internet gefunden habe.

In meinem Scenario besteht meine Aufgabe darin, in einer vorhandene PDF mit vorhandenen Input Felder (Eingabefelder), diese individuel anzusprechen und mit bestimmten Werten zu beschreiben.

 

Mein Aufbau ist wie Folgt: Diese PDF liegt in einem Ordner mit einer html Datei, worin sich der Script befinden soll. Man geht auf die html, lädt in der Webseite eine bestimmte csv Datei hoch. Diese tu ich auswerten, über die Webseite noch ein paar informationen hinzufügen, um dann des in die PDF reinzuschreiben und ausgefühlt anschließend herunterzuladen.

 

Ich kann die PDF in Textform auslesen, worin ich, wenn ich zuvor Platzhalter in die Eingabefelder platziert habe, diese ändere, dann diese veränderte Werte zwar in der PDF sehe, aber wenn ich diese versuche zu ändern, noch der alte Platzhalter drin steht.

Wüsstet Ihr einen Weg oder gar einen Script womit man den kodierten "Echten" Text unterhalb der Eingabefelder auf der pdf mit ändert oder gar irgendeine andere Lösung zu meinem Problem, womit ich die Felder individuell ansprechen und diese sammt der Kodierung durch den Javascript in der Webseite ändern kann.

 

Ich bedanke mich im vorraus!

MfG

TOPICS
Acrobat SDK and JavaScript

Views

243

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2020 Nov 02, 2020

Copy link to clipboard

Copied

You can do it, but not with Acrobat nor in the way you described. You can't edit PDF files like they are plain-text files, because they are not... You need to use a PDF library to populate the fields with the data from the CSV. This can be done using PHP, or even Java, for example.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 02, 2020 Nov 02, 2020

Copy link to clipboard

Copied

LATEST

Hello try67,
jep, I saw it in the source code of the PDF. It is coded in a specific way. Do you know in which codec it is transcripted?

It was exactly my question, if you know a method which i can use in javascript to change it. Unfortunately I can not use PHP in this case, couse it has to proceed on a device localy via a browser like Chrome. I recently found a library called pdf-lib https://pdf-lib.js.org/  but I can not find a way to change the plank text inside a pdf. I think that there is no this kind of function in this library yet.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines