Posted 12 June 2023, 9:16 am EST
- Updated 13 June 2023, 2:58 am EST
I have two streams and want to merge selected page like page 2 from stream 1 and page 4 and 6 from stream 2. How i can do this using GC PDF ? i used PageCollection pageCollection = doc.Pages; but i am not able to merge the selected pages.
var pdfDocument = new GcPdfDocument();
GcPdfDocument doc = new GcPdfDocument();
GcPdfDocument doc2 = new GcPdfDocument();
doc.Load(stream1);
doc2.Load(stream2);
PageCollection pageCollection = doc.Pages; //6
PageCollection pageCollection2 = doc2.Pages; //5
GcPdfDocument selectedPage1 = new GcPdfDocument();
GcPdfDocument selectedPage2 = new GcPdfDocument();
var ms= pageCollection[4].GetStream();
selectedPage.Load(ms);
var ms2= pageCollection2[3].GetStream();
pdfDocument.MergeWithDocument(selectedPage);
selectedPage2 .Load(ms2);
pdfDocument.MergeWithDocument(selectedPage2 );
tthis gives me error '%%eof marker is not found when we load stream on selectedpage.
}
This code giving me error '%%eof marker is not found .