Convert text to PDF

Hi I have a doubt.
I have text in 2 separate notepads. I need to merge both the note pads and convert to pdf and send as a mail.

Can anyone help me with this.

Thanks in advance

  1. Use Read Text file activity to read the data from Text file and it will give output as String. Let’s say InputText.
  2. And then use Append Text activity inside Word Application Scope and pass InputText to it and then use Save Document as PDF activity Word application scope to export word document as PDF file.

my data is in notepad

Hi @honey.123.631
Try this

Hope this helps!!

Regards,

Hi @honey.123.631 ,

  1. Use Read Text File: Pass the file path for file1. Store it in variable: dataFile1.
  2. Use Read Text File: Pass the file path for file2. Store it in variable: dataFile2.
  3. Assign TotalData: dataFile1+Environment.Newline+dataFile2( If you want the data of file2 from secondline, else TotalData= dataFile1+ " " +dataFile2.)
  4. Use Word Application Scope: give fileName: ConsolidatedData.docx, Use Append Text Activity.
  5. Use Save Document as PDF and give somefilename.pdf.
  6. Use the PDF wherever you want.

Thanks
Aditya!

Take an array and store the directory path where your text files store.
In “for each” loop take “if condition” in if condition put “Path.GetFileName(currentitem).ToString.Contains(“txt”)” to process only text or notepad data so that in future you may have no of notepad files .in that you take “append text” activity to append the data in various text files.
Outside for each loop use:
Use Word Application Scope: give fileName: ConsolidatedData.docx, Use Append Text Activity.
Use Save Document as PDF and give somefilename.pdf.
Use the PDF wherever you want.

Hi @adiijaiin Can you please share through xaml as I am getting an error

hi @honey.123.631

You can go through this:

TempDoc.docx (11.7 KB)
WordData.xaml (6.5 KB)
file1.txt (28 Bytes)
file2.txt (25 Bytes)
GeneratedPDfFile.pdf (36.8 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.