Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Concatenating Documents Results in Blank Pages

$
0
0
Aspose.PDF .NET 10.4, from Nuget.  I have a license.

When I try to concatenate documents, the doc has the correct number of pages, but they are blank.  Not cool. 

I followed this example: http://www.aspose.com/docs/display/pdfnet/Concatenate+PDF+Files
public string VerifyAppendedDocuments()
{
	Document parentDoc = new Document();

	Document childDoc = new Document();

	var page = childDoc.Pages.Add();
	page.Paragraphs.Add(new TextFragment("First Child Page"));

	page = childDoc.Pages.Add();
	page.Paragraphs.Add(new TextFragment("Second Child Page"));

	for (int i = 1; i <= childDoc.Pages.Count; i++)
	{
		childDoc.Pages[i].Paragraphs.Add(new TextFragment("Page " + i));
	}

	// *****************************************
	// this should work!
	parentDoc.Pages.Add(childDoc.Pages);


	//but it exports 2 blank pages!
	string exportPath = Path.Combine("c:\\temp", "AppendedDocTest.pdf");
	parentDoc.Save(exportPath);

	//has stuff
	string childExportPath = Path.Combine("c:\\temp", "AppendedDocChildTest.pdf");
	childDoc.Save(childExportPath);

	return exportPath;
}

Viewing all articles
Browse latest Browse all 3131

Trending Articles