1

In my Application I'm using some webservice that returns me a pdf file in base64binary format. In my code I'm getting this file as byte[].

My question is how to combine 2 byte[] into a single and store it as pdf correctly?

So far I store each pdf file separately:

byte[] bytes = image.ImageData; // WebService that returns base64binary as byte[]
System.IO.FileStream stream = new FileStream(@"C:\Test\" + "File_" + i + ".pdf", FileMode.CreateNew);
System.IO.BinaryWriter writer = new BinaryWriter(stream);
writer.Write(bytes, 0, bytes.Length);
writer.Close();
Bryuk
  • 3,295
  • 10
  • 45
  • 74

1 Answers1

1

Alternatively you could save them as separate pdfs and use iTextSharp to merge two pdfs...

Sample code is available in below question

Merging multiple PDFs using iTextSharp in c#.net

Community
  • 1
  • 1
Junaith
  • 3,298
  • 24
  • 34
  • Thanks. It's not exactly what I was looking for, but it's good. It means I will do multiple steps: Store all pdf files > Combine them into single file > Delete all files that I don't need – Bryuk Jan 17 '14 at 16:41