[ 
https://issues.apache.org/jira/browse/OPENMEETINGS-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16081946#comment-16081946
 ] 

Maxim Solodovnik commented on OPENMEETINGS-427:
-----------------------------------------------

Working JS code for 4.0.0

{code:javascript}
var evt = new MouseEvent('click', {
    view: window,
    bubbles: false,
    cancelable: true
  });

  var a = document.createElement('a');
  a.setAttribute('download', 'MY_COOL_IMAGE.png');
  a.setAttribute('href', 
$('#wb-tab-0').data().getCanvas().toDataURL({format:'png', width: 1275, height: 
1650, left: 0, top: 0}));
  a.setAttribute('target', '_blank');

  a.dispatchEvent(evt);
{code}

multiple canvases might be sent to server start PDF download (pdfbox)

> ExportPDF
> ---------
>
>                 Key: OPENMEETINGS-427
>                 URL: https://issues.apache.org/jira/browse/OPENMEETINGS-427
>             Project: Openmeetings
>          Issue Type: Improvement
>            Reporter: Allemand Sylvain
>             Fix For: 4.0.0
>
>         Attachments: OPENMEETINGS-427-ExportPDF.patch
>
>
> Hello, 
> I worked on implementation of a new functionality : the export of a PDF file 
> with the corresponding painted objects (annotations). 
> I found a starting solution in the ExportToImage.java file.
> The current only permits exporting painted objects in SVG format. 
> To implement Export PDF, my approach was :
> get painted objects corresponding to each page of the PDF file
> convert per slide all objects in one SVG file.
> Convert resulting SVG files to PDF files (with Batik Rasterizer library : Fop 
> and Avalon library were needed by Batik Rasterizer). Each SVG file is cropped 
> according to the original current PDF page size (by this way, PDF document 
> with multi-size pages is possible).
> If none objects are painted on a slide, I create a blank PDF page (because 
> the overlay function needs two document with same amount of page and same 
> page sizes). 
> Merge all PDF files in one. 
> Overlay this PDF file in the original PDF file.
> Send the result file to explorer and delete temporary files (and delete 
> result file in the end).
> The resulting PDF is more or less the same size than the original PDF file 
> (only depending on the number of painted objects)
> Enjoy the result
> i got some problems : 
> i try to get the swfzoom value. I create an accessor but i have  an error on 
> execution (Null Exception). I can't get this value, so for the moment, i stay 
> with a value of 72 dpi. (this value is very important for the convert 
> function SVG to PDF.
> I also comment the cropping of orginal PDF file to keep orginal page size for 
> the original document.
>  (poly2bitmap option in GenerateSWF.java).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to