Dear Aspose team,
I have a PDF file generated from a html file and when I try to
send the generated PDF to a printer using LPR/LPD the PDF it isn’t printed correctly. I tried all
the existing Aspose.Pdf.PdfFormat’s but none are printed correctly and the output
result was slightly differed for each Aspose.Pdf.PdfFormat
I attached zipped html file
I hope you
can help me,
Paul Haerkens
my Code
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(“Aspose.Total.lic”);
Aspose.Pdf.HtmlLoadOptions htmlLoadOptions = new Aspose.Pdf.HtmlLoadOptions();
htmlLoadOptions.PageInfo.Margin.Bottom = 10;
htmlLoadOptions.PageInfo.Margin.Top = 10;
htmlLoadOptions.PageInfo.Width = Aspose.Pdf.PageSize.A4.Width;
htmlLoadOptions.PageInfo.Height = Aspose.Pdf.PageSize.A4.Height;
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(html)), htmlLoadOptions);
MemoryStream stream = new MemoryStream();
pdfDocument.Convert(stream, Aspose.Pdf.PdfFormat.v_1_5, Aspose.Pdf.ConvertErrorAction.Delete);
pdfDocument.Save(ticket.FullName, Aspose.Pdf.SaveFormat.Pdf);
pdfDocument.Dispose();
stream.Dispose();
Printing command sample
c:> lpr -Sprinter’s IP address [-Poption] [-ol] \path\file name
<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>NL</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>
<![endif]–>