Is it possible to make input fields read-only through CSS?

With CSS only? This is sort of possible on text inputs by using user-select:none: .print { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } JSFiddle example. It’s well worth noting that this will not work in browsers which do not support CSS3 or support the user-select property. The readonly property should be ideally given … Read more

QTableView printing

Here is a variation of the first answer that gets rid of the intermediate file. QString strStream; QTextStream out(&strStream); const int rowCount = pPublic->tableView->model()->rowCount(); const int columnCount = pPublic->tableView->model()->columnCount(); out << “<html>\n” “<head>\n” “<meta Content=\”Text/html; charset=Windows-1251\”>\n” << QString(“<title>%1</title>\n”).arg(strTitle) << “</head>\n” “<body bgcolor=#ffffff link=#5000A0>\n” “<table border=1 cellspacing=0 cellpadding=2>\n”; // headers out << “<thead><tr bgcolor=#f0f0f0>”; for (int … Read more

@Media print css

If that is the exact structure of your html then this will work for you. @media print { nav, div > div:not(.to-print), div + div:not(.to-print) { display: none; } } /* So you can see the styles working on the elements you want to hide outside of print */ nav, div > div:not(.to-print), div + … Read more

Android – how to get or set (print) DPI ( dots per inch ) of JPEG file while loading or saving it programmatically?

Just for convenience here is ready to copy and paste method: public static void saveBitmapToJpg(Bitmap bitmap, File file, int dpi) throws IOException { ByteArrayOutputStream imageByteArray = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, imageByteArray); byte[] imageData = imageByteArray.toByteArray(); setDpi(imageData, dpi); FileOutputStream fileOutputStream = new FileOutputStream(file); fileOutputStream.write(imageData); fileOutputStream.close(); } private static void setDpi(byte[] imageData, int dpi) { imageData[13] = … Read more

How to get Print Job Status using C#

You might be able to use WMI for this. It provides several printing-related classes, including Win32_PrintJob. This is untested, but something like this should get you started: SelectQuery query = new SelectQuery(“Win32_PrintJob”); using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query)) using (ManagementObjectCollection printJobs = searcher.Get()) foreach (ManagementObject printJob in printJobs) { // The format of the Win32_PrintJob.Name … Read more