Skip to main content

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.

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.


@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''

 


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)


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?


Reply