Changes

Line 63: Line 63:       −
:'''1)''' (this is no way related to abiword's print to pdf ability)
+
<deprecated> :'''1)''' (this is no way related to abiword's print to pdf ability)
 
:The right click menu of an item in the journal will have a new option, i.e. send for network printing. When clicked, the item will be sent to a local virtual CUPS-PDF printer for PDF conversion, and the pdf will have metadata attached stating its details (this PDF plus metadata wont be visible to the user).The object is then said to be marked for printing and can be unmarked for printing too.(That is by again right clicking on the parent journal item and clicking cancel for network printing).
 
:The right click menu of an item in the journal will have a new option, i.e. send for network printing. When clicked, the item will be sent to a local virtual CUPS-PDF printer for PDF conversion, and the pdf will have metadata attached stating its details (this PDF plus metadata wont be visible to the user).The object is then said to be marked for printing and can be unmarked for printing too.(That is by again right clicking on the parent journal item and clicking cancel for network printing).
 
:Also a similar button will be provided for saving to PDF. Which will result in a PDF file of the same parent in journal;the pdf will be tangible. (plus text will be mapped as text only)
 
:Also a similar button will be provided for saving to PDF. Which will result in a PDF file of the same parent in journal;the pdf will be tangible. (plus text will be mapped as text only)
 
:The usecase would be, distinction of saving a pdf and sending it to printing. And the conversion is mandatory so as to prevent a scenario where the sugar file type might not be recognized by the teacher's machine.
 
:The usecase would be, distinction of saving a pdf and sending it to printing. And the conversion is mandatory so as to prevent a scenario where the sugar file type might not be recognized by the teacher's machine.
 +
</deprecated>
 +
 +
As tomeu(the sugar maintainer) had pointed a potential disaster with the step-1 (which is the massive overhead if filters that would be needed for conversion with CUPS, and would be very hard to maintain) and after talking to him, I have sketched out this proposal.
 +
 +
 +
:'''1)''' Every PDF conversion takes place within the activity and it outputs that file to the datastore, the printing to devices such as usb printer also takes place within the activity itself. There will be a simple activity to configure choose and configure basic options (the advanced ones will be disabled for simplicities sake)
 +
There will be 
    
:We will be using moodle as our interface for sending print requests on the network. The interface will have a user page and a teacher page. The page will have a report of his print jobs and a status report of his live jobs. And the ability to put 3 live jobs on queue. The number of upload slots will be dynamically updated according to his live jobs pending for teacher's approval(which is a maximum of 3). And the number of free slots will automatically be filled up by the browser with the to-print PDFs. And then these objects will be sent to the moodle web folder.
 
:We will be using moodle as our interface for sending print requests on the network. The interface will have a user page and a teacher page. The page will have a report of his print jobs and a status report of his live jobs. And the ability to put 3 live jobs on queue. The number of upload slots will be dynamically updated according to his live jobs pending for teacher's approval(which is a maximum of 3). And the number of free slots will automatically be filled up by the browser with the to-print PDFs. And then these objects will be sent to the moodle web folder.
Line 80: Line 87:       −
:For step-1, We use CUPS. The API has a nice array of functions, one of which is to get the printer's name (the cups-pdf virtual printer).And print our file as a PDF in the datastore. Which is pretty much the same for saving as PDF, or sending to moodle.(in the latter we just dont display it, in the former we do)  
+
<deprecated>:For step-1, We use CUPS. The API has a nice array of functions, one of which is to get the printer's name (the cups-pdf virtual printer).And print our file as a PDF in the datastore. Which is pretty much the same for saving as PDF, or sending to moodle.(in the latter we just dont display it, in the former we do)  
:For the sake of our python convenience we will be using a python wrapper to cups, pycups. The print objects will have metadata attached to them through the sugar datastore API.  
+
:For the sake of our python convenience we will be using a python wrapper to cups, pycups. The print objects will have metadata attached to them through the sugar datastore API.</deprecated>
 +
 
 +
:For step-1, We use the py gtkprint api (a high level wrapper around CUPS), which prints any cairo supported objects,features methods to configure the printers and page layouts, and prints. http://pastebin.be/17860 Here is a hack of edit which I've made. This Hack can pretty much print to any printer configured locally, and to pdf.
    
:For the second part of it when ever the print page url is accessed, we make browse communicate with the moodle print queue through xmlrpclib to get the queue details, and upload that many slots (as the number of slots will also be dependent on the print queue through a php trick). This would mean a rainbow hack so that browse can communicate with journal without a dialog (Or a simpler way will be to bypass the dialog automatically). The execution part of this will take place dynamically as soon as the user requests the print page. And also, once the pdf is read, it is destroyed.
 
:For the second part of it when ever the print page url is accessed, we make browse communicate with the moodle print queue through xmlrpclib to get the queue details, and upload that many slots (as the number of slots will also be dependent on the print queue through a php trick). This would mean a rainbow hack so that browse can communicate with journal without a dialog (Or a simpler way will be to bypass the dialog automatically). The execution part of this will take place dynamically as soon as the user requests the print page. And also, once the pdf is read, it is destroyed.
Line 155: Line 164:  
:'''Milestone 1'''
 
:'''Milestone 1'''
   −
:'''Week 1 : '''
+
:'''Week 1 : ''':: Start work on Read and Write so they can save docs as PDF, and print to usb printer
:Write code which prints to any selected printer. (CUPS-pdf will be the primary case till gsoc), and add the print buttons to the item right click menu of journal.
+
 
:Start working on browse hack to parse file paths to the print page's forum input box.
      
:'''Week 2 : '''
 
:'''Week 2 : '''
 +
::Start working on browse hack to parse file paths to the print page's forum input box.
 
:Finish with browse. get community feedback
 
:Finish with browse. get community feedback
   Line 190: Line 199:  
:'''Beyond GSoC:'''
 
:'''Beyond GSoC:'''
 
:''primary focus'':
 
:''primary focus'':
:*Add a direct network printing mechanism ( avahi if not the CUPS provided Bonjour for DNS-SD/mDNS) and print directly to the print server through wi-fi.This will be in the form of a new button in the journal item's menu.This will be disabled when ever an XS is connected.
+
:*Add a direct network printing mechanism ( avahi if not the CUPS provided Bonjour for DNS-SD/mDNS) and print directly to the print server through wi-fi. This will be .This will be disabled when ever an XS is connected.
 
:I have written a sample program http://pastebin.be/17562  
 
:I have written a sample program http://pastebin.be/17562  
 
:What this does is, it gets the list of printers from the print server, and prints to the default configured one.
 
:What this does is, it gets the list of printers from the print server, and prints to the default configured one.
Line 197: Line 206:  
:''Secondary focus:''
 
:''Secondary focus:''
 
:*Make the printing feature an integral part of the API so that printing can be done directly without the journal UI's intervention
 
:*Make the printing feature an integral part of the API so that printing can be done directly without the journal UI's intervention
:*Make a CP activity to select the default printer.
      
====You and the community====
 
====You and the community====
143

edits