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

text file

New Here ,
Feb 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

Hello,

 

How can i read a text file opening a PDF to retrieve the number (text) and display it in a field ?

 

Thanks in advance

JC

TOPICS
JavaScript , PDF forms

Views

1.1K

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 ,
Feb 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

Please explain your workflow in detail. Are you converting a text file to PDF? or do you need to get a value from a text file and put it into a field on an existing PDF form?

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Feb 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

re,

Yes I need to get a value from a text file and put it into a field on existing PDF form..

 

but, I have in the PDF form and i would like that when opening it retrieves a number a put into field adn when saving it can increase the number in text file.

the PDF form must have an incremental number

 

Thanks

JC 

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
Community Expert ,
Feb 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

LATEST

From an Acrobat script, the contents of any file can be acquired with the util.readStreamFromFile() function.

Here's the reference entry:

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/JS_API_AcroJS.html#readfileintostr...

 

It includes an example of reading a text file. 

 

Now the second part is parsing the text file format to get your number. How is this text formatted?

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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