i can print using txt file printer, however, when change docx or pdf many undefined characters cannot understood @ all. guys have ideas on how solve this. the code used. import system import javax.print import java.io java.lang import thread filestream = java.io.bufferedinputstream(java.io.fileinputstream("c:/geeks.txt")) psinformat = javax.print.docflavor.input_stream.autosense mydoc = javax.print.simpledoc(filestream,psinformat,none) aset = javax.print.attribute.hashprintrequestattributeset() aset.add(javax.print.attribute.standard.copies(2)) services = javax.print.printservicelookup.lookupdefaultprintservice() job = services.createprintjob() job.print(mydoc, none) thread.sleep(20000) filestream.close() .docx files have far more formatting , nonsense going on text file. open 1 using notepad , you'll see i'm talking about. because of this, you'll need use dedicated library read docx file, such https://pypi.python.org/pypi/docx/0.2.4 ...
i writing qtquick desktop application. use both c++ (for functionality) , qml (for ui) in it. use qquickview show interface written in qml. i want application reside in system tray when minimised. i mean functionality similar example. http://qt-project.org/doc/qt-4.8/desktop-systray.html . trying implement feature not find way in qt quick application. here main.cpp code: #include <qguiapplication> #include <qqmlengine> #include <qqmlcontext> #include <qqmlfileselector> #include <qquickview> #include "myapp.h" int main(int argc, char* argv[]) { qguiapplication app(argc,argv); app.setapplicationname(qfileinfo(app.applicationfilepath()).basename()); qdir::setcurrent(qapp->applicationdirpath()); myapp myappobject; qquickview view; view.connect(view.engine(), signal(quit()), &app, slot(quit())); view.rootcontext()->setcontextproperty("myappobject", &myappobject); new qqmlfilese...
i wanted use c# visual studio open command prompt using process.startinfo.filename , process.startinfo.arguments give commands automatically not work out. knows how this? ( using cmd call python script ) try using following. hope helps. replace notepad.exe else like. process p = new process(); p.startinfo = new processstartinfo("cmd.exe", "/c notepad.exe"); p.start(); please refer http://ss64.com/nt/cmd.html more details.
Comments
Post a Comment