Yep, have a look at the ImageFactory in SWTChart Extensions:
ImageFactory<ChromatogramChart> imageFactory = new
ImageFactory<ChromatogramChart>(ChromatogramChart.class, 800,
600);
ChromatogramChart chromatogramChart = imageFactory.getChart();
chromatogramChart.setBackground(chromatogramChart.getBaseChart().getDisplay().getSystemColor(SWT.COLOR_WHITE));
...
imageFactory.saveImage(exportFolder + File.separator + prefix +
".png", SWT.IMAGE_PNG);
On a headless Linux server, Xvfb could be utilized. Otherwise,
resolution is limited by Display size.
Best,
Philip
Am 01.04.19 um 17:09 schrieb Sanatt
Abrol:
Great.
Also, how do you like the idea of converting our base
scrollable chart into an image and then converting into a PDF?
We can give the user some options like deciding page size,
adjusting alignment, adding text, etc? This could be done
under the extensions menu for SWTChart and then open a
fileChooser to get the URI for the final pdf file.
Also I found out, that in Java, all rendering goes through
the Graphics2D abstract class. We can
SVGGenerator2D class from the Apache Batik project to create
.svg files for our charts.
We can repeat the same process for conversion to .eps format.
I've found multiple examples on the Apache XMLGraphics project
which illustrate this.
I'll be adding them to my draft proposal and share them
with you soon.
Also, I've noticed that many students are posting their
proposal drafts on the [soc-dev] mailing list. Is it ok, if I
post a link to my draft proposal in [swtchart-dev] instead of
[soc-dev]?
Yep, on all projects
we're working on the development branch.
The exported LaTeX table could be pasted in a *.tex
document. Sure, it would be great if the export offers a
Clipboard solution too or a way to export an LaTeX image.
This could be part of the GSoC proposal.
Best,
Philip
Am
01.04.19 um 15:45 schrieb Sanatt Abrol:
Yes, found it thank you. I
was looking in the 'master' branch earlier. It was in
the 'develop' branch.
About copying LaTeX table to clipboard. Do we have to
simply put the LaTeX table generated by the
tableExportHandler to the system clipboard?
Hi Sanatt,
the PDFBox extensions, which I've written, are
part of ChemClipse:
org.eclipse.chemclipse.pdfbox.extensions
org.eclipse.chemclipse.pdfbox.extensions.fragment.test
git://git.eclipse.org/gitroot/chemclipse/org.eclipse.chemclipse.chemclipsecore.git
We probably could move the Code from ChemClipse
to SWTChart.
It would be great if the user could select page
size, alignment, etc.. The PDFBox extension
PageUtil should contain already many of the
desired alignment features. Some are missing
like print a polygon or print the Bar, Line,
Scatter chart. This could be part of the work.
In SWTChart, we already have a LaTeX table
export on board. This might match your needs.
Have you already had a look at TeXClipse?
https://projects.eclipse.org/proposals/eclipse-texlipse
Best,
Philip
Am
01.04.19 um 15:26 schrieb Sanatt Abrol:
Hi Philip,
I was working on writing the proposal and
I can't find org.eclipse.chemclipse.pdfbox.extensions
Is this moved elsewhere?
Earlier,
I found this bug
report with an example on how to use the
PDFBox library.
Also, when adding the PDF export option,
I think it would be helpful to give the user
options to select page size, alignment
options, insert captions, etc. What do you
think about this?
We also need to copy a pre-built LaTeX
table to the clipboard. Is this the same
LaTeX table exported from org.eclipse.swtchart.extensions.menu.export.LaTeXTableExportHandler.java
Best,
Sanatt
Yep, that sounds like a good plan.
Apache is a good choice and Apache
Batik and others are already listed in
Eclipse Orbit:
https://download.eclipse.org/tools/orbit/downloads/drops/R20190226160451/
It means, that when can use them out
of the box.
Please share your proposal and keep an
eye on the GSoC deadlines.
Best,
Philip
Am
27.03.19 um 09:34 schrieb Sanatt
Abrol:
Hi Philip,
Thank you for your quick
reply. Yes, I am interested in
doing this project as part of
GSoC 2019. I am sorry for being
late to the party :P as I was
travelling abroad for the past
three weeks and unable to give
this the required effort. I've
looked into the code base, we
can add new export handlers to org.eclipse.swtchart.extensions.menu.export
package.
I'll look into the PDFBox
library and see how we can use
it for our purpose. Your work on
the chemclipse project
is really helpful.
For .svg and .eps formats,
which are basically XML files, I
suggest we use Apache
XML Graphics Project which
has a similar license to Apache
PDFBox. Please let me know what
you think about this.
I will share with you a draft
proposal by April 2nd which will
give us a week's time to make
required changes before the
April 9th deadline.
Danke,
Sanatt
Hi Sanatt,
iText s licensed under the
AGPL, so it will never find
its way into the Eclipse
ecosystem.That's why I would
recommend to use Apache
PDFBox. We already have a CQ
in ChemClipse for Apache
PDFBox version 2.0.6. So I
would recommend trying to
bring 2.0.6. and the latest
version 2.0.14 to Eclipse
Orbit so that it can be easily
re-used by Eclipse projects:
Apache PDFBox
https://pdfbox.apache.org
Eclipse Orbit
https://download.eclipse.org/tools/orbit/downloads/drops/R20190226160451/
PDFBox is a powerful library.
But it needs some knowledge to
align elements like text,
images. Especially if you'd
like to layout a report e.g.
in DIN A4 with center top left
and scale mm. That's why I
have already written an
extension to use this library
in a more convenient way:
https://git.eclipse.org/c/chemclipse/org.eclipse.chemclipse.chemclipsecore.git?h=develop
org.eclipse.chemclipse.pdfbox.extensions
org.eclipse.chemclipse.pdfbox.extensions.fragment.test -> see options
in PageUtil_1_ITest
Writing an export converter
for SWTChart is a great idea.
It's already possible to add
new export converter via two
options
A) add a menu extension
B) register an extension via
the extension point
Have a look at the example
bundle
(org.eclipse.swtchart.extensions.examples)
package
(org.eclipse.swtchart.extensions.examples.menu):
A) ZoomInHandler... ->
chartSettings.addMenuEntry(new
ZoomInHandler());
B) ResetXAxisHandler... ->
MenuEntry="org.eclipse.swtchart.extensions.examples.menu.ResetXAxisHandler"
I've also played with the
library VectorGraphics2d, but
it is licensed under the GPL
(see problem iText), so it
can't be bundled with
SWTChart:
https://github.com/eseifert/vectorgraphics2d
https://github.com/OpenChrom/swtchartvectorgraphics/tree/develop
So, I could be a mentor to
help you implementing
extensions via the GSoC
program. Student applications
period is open until April,
9th. Do you plan to attend and
to submit a proposal?
https://summerofcode.withgoogle.com/dashboard/timeline/
Best,
Philip
Am
26.03.19 um 18:32 schrieb
Sanatt Abrol:
Hi everyone,
I hope you are doing well.
We need to add new export
options like .pdf, .svg
etc.
I was doing some
research over this and
found iText and
Apache
PDFBox as
libraries we can use to
export our 'imageData'.
iText has both free
and commercial license
which I doubt we can use
in our case. Apache
PDFBox however is
open-source.
Is it possible to use
Apache PDFBox for our
project?
If not, then I
suppose we are required
to write our own 'pdf
exporter' which is
something I think the
whole Eclipse community
can benefit from (if
something like this is
not already written by
the community).
Please let me know
what you think :)
Regards,
Sanatt
_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options,
retrieve your password, or
unsubscribe from this list,
visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev
_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options,
retrieve your password, or unsubscribe
from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev
_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your
password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev
_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev
_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
|