Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Improve PDF Output Quality

More
11 years 1 month ago #9705 by thessa.alink
I would like to ask how to improve the quality of the PDF created using the code below:
---
Document document = new Document();
document.Create("test.pdf");
document.SetCache(Global.tmp_path + "/temp.dat");
.
.
.
currentPage = Bitmap.createBitmap(currentPage, 0, 0, currentPage.getWidth(), pageHeight);

Document.DocImage dimg = document.NewImage(currentPage, true);
currentPage.recycle();
ResImage rimg = page.AddResImage(dimg);

com.radaee.pdf.Matrix mat = new com.radaee.pdf.Matrix(currentPage.getWidth() - (PAGE_MARGIN * 2), pageHeight - (PAGE_MARGIN * 2), PAGE_MARGIN, yOffset);
pageContent.GSSetMatrix(mat);
mat.Destroy();

pageContent.DrawImage(rimg);
pageContent.GSRestore();

// Add Content to Page
page.AddContent(pageContent, true);
pageContent.Destroy();
page.Close();
pageNum++;
}

document.Save();
document.Close();
---
I saved currentPage as PNG and compared it with the output PDF and noticed the degrade in the image quality. I attached test.PNG and test.PDF.
More
11 years 1 month ago - 11 years 1 month ago #9706 by radaee
Replied by radaee on topic Improve PDF Output Quality
plz compare Bitmap.width and width of PNG file.
seems some pixels lost when load bitmap.
Last edit: 11 years 1 month ago by radaee.
Time to create page: 0.357 seconds
Powered by Kunena Forum