poi PropertyTemplate.Extent vs BorderExtent - java

I'm just working with Borders using the POI library (Thank you for the amazing work!) and I've just discovered the PropertyTemplate. While going through the Quick Guide (https://poi.apache.org/spreadsheet/quick-guide.html#DrawingBorders) I wrote up the following:
propertyTemplate.drawBorders(range, borderType, color, extent);
While trying to fill in the extent following the quick-guide, it shows "PropertyTemplate.Extent.ALL" for example as a constant. When I try to match that, the PropertyTemplate.Extent does not exist.
I tried however with "BorderExtent.ALL" and that works. Is it just a typo in the quick-guide?
I looked for a way to contact them directly about the quick guide but I didn't want to go through all the mailling list or bug contribution sections just for an update on the website.
Does anyone know:
If BorderExtent.ALL (or any of the other constants) is correct or should it be PropertyTemplate.Extent.ALL and I'm doing something wrong?
Is there a way to notify the POI team to update the Quick-Guide without disturbing to many people?
Thank you!
Alex

Related

Pseudo-element :after not working anymore after upgrading 'openhtmltopdf' to v1.0.10

I'm working on a project, where we use thymeleaf to design .html files. These are being transformed to pdf using danfickles pure-Java library.
Because the framework doesn't support CSS3 features, one has to work a lot with tables and such.. In our case we used to "clean up" after specific elements, decorating them with
.icon-headline:after {
content: "";
display: table;
clear: both;
}
This was used to make sure, float: left and such were cleared so they wouldn't interfere each other. This, let me call it, "small hack" doesn't work anymore. I noticed in the patchnotes a line about
#711 (mixed) Better boxing for ::before and ::after content. Should now be able to define a border around pseudo content correctly.
Full patchnotes can be found Openhtmltopdf github repo
I'm now looking for a way to reproduce this behavior. Maybe anyone has got any tip and I hope I made it clear what the problem is. If not I'm happy to clarify further.
Thanks in advance,
Ayume

atom-java-snippets: Render the snippets.cson file in real-time before typing prefix in java file?

Hello world! My name is Hank Igoe and this is my first time posting. I've been using atom-java-snippets with the Atom IDE, and they work great. There is one minor tweak I'd love to have, though. It would be nice to have a WYSIWYG pane for the 'body' section that showed what it would look like after rendering from the snippets.cson file.
For example, here's a snippet to make a Java interface:
'snippet-interface':
'prefix': 'iface'
'body': 'public interface ${1:IfaceName} {\n
${2:METHODS}\n}${3}'
It's not that hard to read, but it would be great if there were a third pane that showed the rendered version of the body, like this:
public interface IfaceName {
METHODS
}
Then I would know it's ready for the code file, and could quit tweaking it to get the spacing right, etc. Of course, you can do this manually by going to the java file, typing the prefix, see what the .cson snippet prints out, then tweak the .cson file if the formatting is off, and lather rinse repeat until it's just right. But I was thinking it would be nice to have the instant feedback that you get when, say, doing html/markup editing in an editor that can do realtime updates.
Anyway, I hope that question is clear, please feel free to post a question if you need clarification.
btw, if such a thing doesn't exist but you all think it's a good feature and would like to add it to atom-java-snippets or create a new plugin, I'd be happy to help out if I can.
Thanks in advance for any advice,
Hank
http://linkedin.com/in/hank-igoe-27419519b/
http://github.com/vujadetech
http://facebook/hank.igoe54

Is it possible to create a custom screen GUI in Bukkit?

I'm wondering if it's possible to add some custom screen GUI's to my Bukkit server. So I can display a lot of text on someone's screen. Or do I need to find another option to do this?
Thanks!
The only practical way is to use an Inventory using blocks with name and lore for users to click on as can be seen here
As Cole Nelson mentioned, a custom inventory with lore displayed might work. A good guide for that can be found on the bukkit forums, and although it's a bit outdated it should still provide useful information.
Another possibility would be to utilize title screens; obviously those can't hold a ton of information, but the player is pretty much guaranteed to notice them immediatly.
I recommend using Title Api, as it's a bit tedious to directly work with packets.
Once you added the jar to your project and set the dependency, simply use:
TitleAPI.sendTitle(player,fadeIn,stay,fadeOut,"Title","Subtitle");
to send a title with all corresponding attributes.
Example result:

Create a pdf with text at given coordinates (PDFBox?)

My Situation:
I'm programming in java
Using a library from a person from my university I'm able to read pdfs and create a XML document out of it
This XML document contains additional informations e.g. the coordinates of the text in the original document
My Problem
I would like to create the read PDF again with the content set at its original coordinates (Again: I have the coordinates)
My Question:
-> Do you know a way to create a pdf and set the text of the pdf at given coordinates? <-
I'm doing a lot of research these days about, but maybe I tried the wrong google search terms since I cant find much helpful results. So i thought I might be able to ask here, in the forum where I found the most help so far in my young "programmers life" :)
Most of the results I get, even here, are about people trying to get the coordinates, but I already have them.
I heard during a discussion that PDFBox might be able to do this, but I'm also happy to work with any other framework or library that is capable for my problem.
Thanks for every help and thought you're sharing with me.
Thanks a lot for your comments. In the end I've decided for iText, which allowed me to do all my tasks (placing text at absolute coordinates, give it a background color by certain criterias) in a quite easy and efficient way.
If someone here is searching for inspiration and has a similar task, check my related post here on stackoverflow for some code snippets How can I add a background color to my (pdf-) text using iText to create it with Java

Generate Images for formulas in Java

I'd like to generate an image file showing some mathematical expression, taking a String like "(x+a)^n=∑_(k=0)^n" as input and getting a more (human) readable image file as output. AFAIK stuff like that is used in Wikipedia for example. Are there maybe any java libraries that do that?
Or maybe I use the wrong approach. What would you do if the requirement was to enable pasting of formulas from MS Word into an HTML-document? I'd ask the user to just make a screenshot himself, but that would be the lazy way^^
Edit: Thanks for the answers so far, but I really do not control the input. What I get is some messy Word-style formula, not clean latex-formatted one.
Edit2: http://www.panschk.de/text.tex
Looks a bit like LaTeX doesn't it? That's what I get when I do
clipboard.getContents(RTFTransfer.getInstance()) after having pasted a formula from Word07.
First and foremost you should familiarize yourself with TeX (and LaTeX) - a famous typesetting system created by Donald Knuth. Typesetting mathematical formulae is an advanced topic with many opinions and much attention to detail - therefore use something that builds upon TeX. That way you are sure to get it right ;-)
Edit: Take a look at texvc
It can output to PNG, HTML, MathML. Check out the README
Edit #2 Convert that messy Word-stuff to TeX or MathML?
My colleague found a surprisingly simple solution for this very specific problem: When you copy formulas from Word2007, they are also stored as "HTML" in the Clipboard. As representing formulas in HTML isn't easy neither, Word just creates a temporary image file on the fly and embeds it into the HTML-code. You can then simply take the temporary formula-image and copy it somewhere else. Problem solved;)
What you're looking for is Latex.
MikTex is a nice little application for churning out images using LaTeX.
I'd like to look into creating them on-the-fly though...
Steer clear of LaTeX. Seriously.
Check out JEuclid. It can convert MathML expressions into images.

Categories

Resources