<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error - Merge PDF Files using PDFSharp DLL in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118139#M52625</link>
    <description>&lt;P&gt;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/62254"&gt;@holuomaVB&lt;/a&gt;&amp;nbsp;Everything in the External References section has to end with ".dll", and it looks like I just left off typing that for System.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jan 2025 15:13:36 GMT</pubDate>
    <dc:creator>david.l.morris</dc:creator>
    <dc:date>2025-01-06T15:13:36Z</dc:date>
    <item>
      <title>Error - Merge PDF Files using PDFSharp DLL</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118039#M52612</link>
      <description>&lt;P&gt;I am trying to creat an Object that merges PDF. I have installed PDFSharp DLL and added namespaces, but it seems to be giving errors. Is there anything am missing? Can anyone provide me a code to merge PDF uisng PDFSharp? Below is my code&lt;/P&gt;&lt;P&gt;Public Sub MergePDFs()&lt;BR /&gt;Try&lt;BR /&gt;' Input file paths&lt;BR /&gt;Dim inputPaths As String() = {"C:\path\file1.pdf", "C:\path\file2.pdf"}&lt;BR /&gt;Dim outputPath As String = "C:\path\merged.pdf"&lt;/P&gt;&lt;P&gt;' Create a new PDF document for output&lt;BR /&gt;Dim outputDocument As New PdfDocument()&lt;/P&gt;&lt;P&gt;' Loop through all input files&lt;BR /&gt;For Each pdfPath As String In inputPaths&lt;BR /&gt;If Not System.IO.File.Exists(pdfPath) Then&lt;BR /&gt;Throw New Exception($"File not found: {pdfPath}")&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;' Open the input document&lt;BR /&gt;Dim inputDocument As PdfDocument = PdfReader.Open(pdfPath, PdfDocumentOpenMode.Import)&lt;/P&gt;&lt;P&gt;' Copy pages from input to output&lt;BR /&gt;For Each page As PdfPage In inputDocument.Pages&lt;BR /&gt;outputDocument.AddPage(page)&lt;BR /&gt;Next&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;' Save the merged document&lt;BR /&gt;outputDocument.Save(outputPath)&lt;/P&gt;&lt;P&gt;Catch ex As Exception&lt;BR /&gt;Throw New Exception($"Error during PDF merge: {ex.Message}")&lt;BR /&gt;End Try&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 09:02:14 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118039#M52612</guid>
      <dc:creator>holuomaVB</dc:creator>
      <dc:date>2025-01-03T09:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error - Merge PDF Files using PDFSharp DLL</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118099#M52613</link>
      <description>&lt;P&gt;What error(s) do you get?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 16:12:10 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118099#M52613</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2025-01-03T16:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Error - Merge PDF Files using PDFSharp DLL</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118103#M52615</link>
      <description>&lt;P&gt;You have VB.NET so this may not help you, but here is some code that I used in the past for PDFSharp to merge Multiple files if you want to switch to C# or use this to compare to yours or rewrite in VB.NET:&lt;/P&gt;&lt;P&gt;Inputs:&lt;BR /&gt;[inputPaths] (DataTable) expecting either just one column or one of the columns to be named "Path".&lt;/P&gt;&lt;P&gt;[newFileName] (Text)&lt;BR /&gt;[outputFolderPath] (Text)&lt;/P&gt;&lt;P&gt;Outputs:&lt;BR /&gt;[outputFilePath] (Text)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;External References:&lt;/P&gt;&lt;P&gt;System&lt;/P&gt;&lt;P&gt;System.Data.dll&lt;/P&gt;&lt;P&gt;System.Drawing.dll&lt;/P&gt;&lt;P&gt;PdfSharp.dll&lt;/P&gt;&lt;P&gt;System.Linq.dll&lt;/P&gt;&lt;P&gt;System.Collections.dll&lt;/P&gt;&lt;P&gt;System.Core.dll&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Namespace Imports:&lt;BR /&gt;System&lt;/P&gt;&lt;P&gt;System.Drawing&lt;/P&gt;&lt;P&gt;System.Data&lt;/P&gt;&lt;P&gt;System.Diagnostics&lt;/P&gt;&lt;P&gt;System.IO&lt;/P&gt;&lt;P&gt;PdfSharp.Pdf&lt;/P&gt;&lt;P&gt;PdfSharp.Pdf.IO&lt;/P&gt;&lt;P&gt;System.Linq&lt;/P&gt;&lt;P&gt;System.Collections&lt;/P&gt;&lt;P&gt;System.Collections.Generic&lt;/P&gt;&lt;P&gt;System.Threading.Tasks&lt;/P&gt;&lt;P&gt;System.Text.RegularExpressions&lt;/P&gt;&lt;P&gt;System.Text&lt;/P&gt;&lt;P&gt;PdfSharp.Pdf.Content&lt;/P&gt;&lt;P&gt;PdfSharp.Pdf.Content.Objects&lt;/P&gt;&lt;P&gt;PdfSharp.Pdf.Advanced&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// set up some variables
string[] files;

if (inputPaths.Columns.Count &amp;gt; 1)
{
	// get a string array out of the Path column
	files = inputPaths.Rows.OfType&amp;lt;DataRow&amp;gt;().Select(k =&amp;gt; k["Path"].ToString()).ToArray();
}
else
{
	// get a string array out of a DataTable regardless of the Field Name
	files = inputPaths.Rows.OfType&amp;lt;DataRow&amp;gt;().Select(k =&amp;gt; k[0].ToString()).ToArray();
}

if (string.IsNullOrEmpty(newFileName))
{
	newFileName = Path.GetFileNameWithoutExtension(files[0]) + "_merged";
}
else
{
	newFileName = Path.GetFileNameWithoutExtension(newFileName);
}

if (string.IsNullOrEmpty(outputFolderPath))
{
	outputFolderPath = Directory.GetParent(files[0]).ToString();
}

outputPath = Path.Combine(outputFolderPath, newFileName + ".pdf");

// Open the output document
PdfDocument outputDocument = new PdfDocument();

// Iterate files
foreach (string file in files)
{
	// Open the document to import pages from it.
	PdfDocument inputDocument = PdfReader.Open(file, PdfDocumentOpenMode.Import);

	// Iterate pages
	int count = inputDocument.PageCount;
	for (int idx = 0; idx &amp;lt; count; idx++)
	{
		// Get the page from the external document...
		PdfPage page = inputDocument.Pages[idx];
		// ...and add it to the output document.
		outputDocument.AddPage(page);
	}
}

// Save the document...
outputDocument.Save(outputPath);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 16:19:37 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118103#M52615</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2025-01-03T16:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error - Merge PDF Files using PDFSharp DLL</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118132#M52622</link>
      <description>&lt;P&gt;Hello Dave,&lt;/P&gt;&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;I’ve tried implementing the code as you suggested, including the exact external references and namespace, but I am encountering an error. The error message is as follows:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Description:&lt;/STRONG&gt; Compiler error at line -22 in the upper section: Metadata file 'System' could not be found.&lt;/P&gt;&lt;P&gt;I’ve attempted to debug the issue, but I haven't been able to identify the cause of the error. Would you be able to provide further assistance or guidance on resolving this issue?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 10:36:35 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118132#M52622</guid>
      <dc:creator>holuomaVB</dc:creator>
      <dc:date>2025-01-06T10:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error - Merge PDF Files using PDFSharp DLL</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118139#M52625</link>
      <description>&lt;P&gt;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/62254"&gt;@holuomaVB&lt;/a&gt;&amp;nbsp;Everything in the External References section has to end with ".dll", and it looks like I just left off typing that for System.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 15:13:36 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118139#M52625</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2025-01-06T15:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error - Merge PDF Files using PDFSharp DLL</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118141#M52626</link>
      <description>&lt;P&gt;Hi Dave,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I did add System.dll and yet the error persist. However, If I remove System and just add System.dll, it displays more errors (screenshot below)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="holuomaVB_0-1736176867644.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40169i3CB2C91BF0369753/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="holuomaVB_0-1736176867644.png" alt="holuomaVB_0-1736176867644.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="holuomaVB_1-1736177060212.png" style="width: 400px;"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/40170i1FE8C520C1B96B6F/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="holuomaVB_1-1736177060212.png" alt="holuomaVB_1-1736177060212.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 15:24:30 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118141#M52626</guid>
      <dc:creator>holuomaVB</dc:creator>
      <dc:date>2025-01-06T15:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error - Merge PDF Files using PDFSharp DLL</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118143#M52627</link>
      <description>&lt;P&gt;The more errors situation is correct. The compiler doesn't even try to determine what actual errors you have if there is a prompt with one of the references. Leave it as "System.dll" and then we can work through each of those errors.&lt;BR /&gt;&lt;BR /&gt;What is the full error message for the one that is cut off? It says like "PE image doesn't contain manage..."&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 15:26:05 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118143#M52627</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2025-01-06T15:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error - Merge PDF Files using PDFSharp DLL</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118144#M52628</link>
      <description>&lt;P&gt;Alright.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Page: Initialise&lt;BR /&gt;Stage: Stage1&lt;BR /&gt;Type: Error&lt;BR /&gt;Action: Validate&lt;BR /&gt;Description: Compiler error at top section line -19: Metadata file 'C:\Program Files\Blue Prism Limited\Blue Prism Automate\PdfSharp.dll' could not be opened -- PE image doesn't contain managed metadata.&lt;BR /&gt;Repairable: No&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 15:41:03 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118144#M52628</guid>
      <dc:creator>holuomaVB</dc:creator>
      <dc:date>2025-01-06T15:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error - Merge PDF Files using PDFSharp DLL</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118145#M52629</link>
      <description>&lt;P&gt;I didn't know what that error message meant, so I Googled it a bit. If I had to guess, it kind of sounds like the PdfSharp.dll file you have may be invalid in some way. Where do you get it from? And do you know how to try to get it again? There are a few ways to do this, but I tend to prefer going into Visual Studio, creating a temp project, installing a NuGet package, build it, and then get the DLL out of the bin folder of the project.&lt;/P&gt;&lt;P&gt;The PdfSharp.dll file I have I believe is an older version of PdfSharp from 2019. The file size is 523 KB.&lt;BR /&gt;&lt;BR /&gt;Regardless, I feel like the PdfSharp file itself is your issue, and that is likely why you had issues before with your VB.NET code.&lt;BR /&gt;&lt;BR /&gt;I would think that the latest version should work no matter what your version of Blue Prism is, but what Blue Prism version are you on?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 15:48:50 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118145#M52629</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2025-01-06T15:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error - Merge PDF Files using PDFSharp DLL</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118153#M52633</link>
      <description>&lt;P&gt;Hello Dave,&lt;/P&gt;&lt;P&gt;Thank you for your response. I’ve also been considering that the issue might be related to the &lt;STRONG&gt;PDFSharp.dll&lt;/STRONG&gt; file. My current Blue Prism version is &lt;STRONG&gt;7.2.1&lt;/STRONG&gt;, and I’m not entirely sure if I can generate a DLL file myself. However, I’ll look into finding an alternative DLL file to see if that resolves the issue.&lt;/P&gt;&lt;P&gt;If you have any recommendations or additional insights, I’d greatly appreciate your guidance.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 07:01:31 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Error-Merge-PDF-Files-using-PDFSharp-DLL/m-p/118153#M52633</guid>
      <dc:creator>holuomaVB</dc:creator>
      <dc:date>2025-01-07T07:01:31Z</dc:date>
    </item>
  </channel>
</rss>

