Hi,
I uploaded the samples files, the two XPS files have some differences on: margins, page width.
I don't know if this is the reason for not printing.
I appreciate your quick response.
The code used to create the XPS:
- Code: Select all
//create PdfDocument instance and load file
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
//doc.PDFStandard.SaveToXPS(@"c:\temp\teste_xps.xps");
//convert Xps to PDF file format
//doc.PageSettings.Margins.All = 10;
//doc.CompressionLevel = Spire.Pdf.PdfCompressionLevel.BestSpeed;
//doc.PageSettings.SetMargins(50);
doc.PageScaling = Spire.Pdf.PdfPrintPageScaling.CustomSacle;
doc.LoadFromFile(@"C:\temp\copia.pdf", Spire.Pdf.FileFormat.PDF);
PaperSize paper = new PaperSize("A4", (int)PdfPageSize.A4.Width, (int)PdfPageSize.A4.Height);
paper.RawKind = (int)PaperKind.A4;
doc.PrintDocument.DefaultPageSettings.PaperSize = paper;
//set the page size to be output automatically from the size of the PDF file:
doc.PageScaling = PdfPrintPageScaling.ActualSize;
//doc.PrintDocument.OriginAtMargins = true;
doc.SaveToFile(string.Format(@"c:\temp\{0}.xps", "Copia_XPS"), Spire.Pdf.FileFormat.XPS);
doc.Close();
Regards,
Jair
Login to view the files attached to this post.