I create a simple document using Aspose.PDF for .NET. When i print it through Preview in OSX (Yosemite) the printer gives the following error:
ERROR: invalidforn
OFFENDING COMMAND: xshow
I attached an image of the printed document and the generated PDF.
The printer is a Lexmark XS950de network attached printer.
Here’s the code to produce the error. I’m using the latest nuget package (11.4.0). The MemoryStream is returned through a WebApi controller.
var adress = “This is the address 123”;
var namn = “ÖÖÖÖÖööö”;
Document doc = new Document();
Page page = doc.Pages.Add();
TextState style = new TextState
{
FontSize = 12,
FontStyle = FontStyles.Regular,
LineSpacing = 4
};
var paragraph = new TextFragment(namn);
paragraph.TextState.ApplyChangesFrom(style);
paragraph.IsInLineParagraph = true;
paragraph.Position = new Position(280, (page.Rect.URY - paragraph.Rectangle.Height) - 560);
TextFragment frag = new TextFragment(adress);
frag.TextState.ApplyChangesFrom(style);
frag.IsInLineParagraph = true;
frag.Position = new Position(280, (page.Rect.URY - frag.Rectangle.Height) - 410);
var textBuilder = new TextBuilder(page);
textBuilder.AppendText(paragraph);
textBuilder.AppendText(frag);
var memStream = new MemoryStream();
doc.Save(memStream);