Skip to main content
Question

PDF2TextReader does not recognize my published parameter for selecting a pdf file into the transformer. Anyone else experienced this?


fme
Contributor
Forum|alt.badge.img+7
  • Contributor

PDF2TextReader does not recognize my published parameter for selecting a pdf file into the transformer. Is there any workaround this? PDF2TextReader runs when I select the pdf file directly but not when I use a parameter in selecting it.

4 replies

danminneyatsaf
Safer
Forum|alt.badge.img+12

Hi @fme​ do you get an error message in the log file that you're able to share with us?

Unfortunately, since this transformer was created by a community user and not by Safe Software, we are unable to make adjustments to the transformer or produce a fix ourselves. I recommend commenting on the FME Hub transformer page itself to see if the original creator has any suggestions.


fme
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 13, 2023

@danminneyatsaf​  this is the error message:

 

The below feature caused the translation to be terminated

PDF2TextReader_<Rejected> (TeeFactory): PDF2TextReader_<Rejected>: Termination Message: 'PDF2TextReader output a <Rejected> feature. To continue translation when features are rejected, change 'Workspace Parameters' > Translation > 'Rejected Feature Handling' to 'Continue Translation''

 


fme
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 14, 2023
danminneyatsaf wrote:

Hi @fme​ do you get an error message in the log file that you're able to share with us?

Unfortunately, since this transformer was created by a community user and not by Safe Software, we are unable to make adjustments to the transformer or produce a fix ourselves. I recommend commenting on the FME Hub transformer page itself to see if the original creator has any suggestions.

I manually entered my file path in a private parameter and used that in the transformer which executed successfully. I tried using scripted parameter to change my file path to \\\\ instead of \\ but cant get the script to work. Any assistance will be appreciated! Please see below my python script for scripted parameter:

 

def add_double_slash(file_path):

  modified_path = ''

  for char in file_path:

    if char == '\\\\':

      modified_path += '\\\\\\\\'

    else:

      modified_path += char

  return modified_path

 

# Example

file_path = r'C:\\Users\\Username\\Documents\\file.txt'

modified_file_path = add_double_slash(file_path)

print(modified_file_path)


danminneyatsaf
Safer
Forum|alt.badge.img+12
fme wrote:

I manually entered my file path in a private parameter and used that in the transformer which executed successfully. I tried using scripted parameter to change my file path to \\\\ instead of \\ but cant get the script to work. Any assistance will be appreciated! Please see below my python script for scripted parameter:

 

def add_double_slash(file_path):

  modified_path = ''

  for char in file_path:

    if char == '\\\\':

      modified_path += '\\\\\\\\'

    else:

      modified_path += char

  return modified_path

 

# Example

file_path = r'C:\\Users\\Username\\Documents\\file.txt'

modified_file_path = add_double_slash(file_path)

print(modified_file_path)

@fme​ are you able to share your workspace showing how you've implemented the user parameter, python script, and PDF2TextReader with us?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings