Created
August 16, 2019 09:40
-
-
Save bjoerntx/a4393531126bc04387676391f3bea50e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void MergeDocument(string Filename, object Data) | |
{ | |
// create a new PassingObject that is used to send | |
// data to the ProcessingApplication using pipes | |
PassingObject dataObject = new PassingObject() | |
{ | |
Data = JsonConvert.SerializeObject(Data), | |
Document = File.ReadAllBytes(Filename) | |
}; | |
// call the processing app and pass the data object | |
ReturningObject returnObject = ParallelProcessing.CallProcessingApp(dataObject); | |
// create destination folder if it doesn't exists | |
Directory.CreateDirectory(sResultsFolder); | |
// write the returned byte array as a file | |
File.WriteAllBytes(sResultsFolder + "\\" + | |
Path.GetFileNameWithoutExtension(Filename) + | |
".pdf", returnObject.Document); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment