I would like to make vertical text in excel output. I am currently using BIRT 4.2.2 with nativexls. I pasted vertical text as .svg image into table header cell but the output looks strange. There is an image with no border around the cell. Is there another way to accomplish this?
output:
image
Again, I'm not familiar with BIRT or nativexls, but you can quite easily specify that a cell has vertical alignment in Excel itself.
On the Cell Formatting screen, set the Alignment to 90 degrees:
This will give you the result you need:
Again, I'm not familiar with the other technologies you're using, so my apologies if this is not helpful (i.e., if you can't adjust the formatting from your workflow). Of course, if you're working with the raw Excel file, you should be update to update the XML files contained within the XLSX container to use the formatting you need.
Related
I am generating a pdf using java and doing the formatting with XSL ..I have few tables that are being generated in the pdf . Problem is the border of the tables are not of even darkness . somepart of the line is dark and some part is light .
How can I correct this formatting .
Thanks
Sometimes a table border might look lighter depending on your Zoom level. If you zoom in and the borders are displaying weird it must be your code to display borders.
Check all of your border settings for:
table
header row
body row
footer row
All of these can be set with different border-top, border-bottom, border-left, and border-right thicknesses.
Print the document. If they are all the same then it is the viewer and resolution of the monitor that is the issue. Many FO renderers use polygons to represent borders so that corners are mitered as they should be for different colors or sizes. Some PDF viewers (especially Reader on Windows) cannot handle thin polygons when the screen representation is but one or two pixels.
Likely there is nothing wrong with the file, it is only the view application.
Best way to set the table properties like color ,font ,alignment is to set those in the <xsl:attribute-set> and then later call this using <use-attribute-sets>.This way you would not have to set the properties at every table cell ,just need to call the attribute set .
I'm trying to create a PDF using iText library. The PDF has to embed an animation, which is a set of bitmaps. And there are buttons to control the animation. To understand it, see the following file:
http://www.texample.net/media/tikz/examples/PDF/wankel-motor.pdf
How can I create such a file from iText?
I know that I can embed a video file with this code:
http://itextpdf.com/examples/iia.php?id=188
But here I don't want to embed a video file, but a set of bitmaps and to add the control buttons.
Thanks in advance,
V. Henley
The document doesn't have any images. Instead it has a large series of Widget annotations inside a rectangle of which the lower-left and upper-right corners have the following coordinates:
llx = 4.981
lly = 287.238
urx = 322.053
ury = 542.754
These widget annotations are buttons that overlap each other and of which the appearance is defined using PDF syntax (paths consisting of straight lines and Bézier curves).
There are also a number of smaller buttons with arrows and other symbols. When clicking them, some JavaScript is executed:
The animations is actually JavaScript alternating the visibility of the different buttons. If you want to know more about the JavaScript that is used, you have to dig into the document using iText RUPS (which is what I did to create the above screen shot).
The principle that is used to create this PDF is identical to the principle that was used in the Calculator example, which is an example that was distributed with the same book you refer to.
Finally, I've been able to create such a PDF using latex code:
This is the latex code:
\documentclass[10pt]{article}
\usepackage{animate}
\usepackage{graphicx}
\usepackage{media9}
\pagestyle{empty}
\begin{document}
\AtEndDocument{%
\label{lastpage}%
}
\animategraphics[width=9.54cm,height=6.36cm,controls]{2}{C:/Users/casa/Documents/programacion/tex/construc_}{0}{3}
\end{document}
So after compiling such code with a latex compiler, it produces a pdf similar to the one I posted.
Kind Regards
First I have created a pdf using itext and java and put a table and tableCell
PdfPTable table = new PdfPTable(2);
table.setWidths(new int[]{1, 2});
PdfPCell cell;
table.addCell("Address:");
cell = new PdfPCell(new Phrase(""));
cell.setFixedHeight(60);
table.addCell(cell);
I have another Program Which read this pdf File
PdfReader reader = new PdfReader("path_of_previously_created_pdf");
Now i want to get TableCell cell and want to Change cell height cell.setFixedHeight(new_Fixed_Height);
It is possible... if Yes .
How??
Thanx in advance
If your PDF contains just that simple 1x2 table, it of course would be possible to implement something that gives you the PDF with a cell hight of you choice.
But I assume it eventually is meant to contain more. Already the code you provided via your google drive included more (more table cells plus form elements), and that code, too, does look unfinished concerning the PDF construction. Thus,...
The direct answer
It is not possible.
First of all the table and cell objects you have while creating the PDF are not present as such in the resulting file, they merely are drawn as a number of lines and some text (or whatever you put into the cells).
Thus, you cannot even retrieve the cells you want to change, let alone change it.
The twisted answer
You could, of course, try and parse the page content stream to find the commands for drawing lines, find those ones among them which were drawn for the cell you are interested in, and try to derive the original cell dimension attributes from the line coordinates. Afterwards you can attempt to move everything below the cell down to create the extra space you want.
Depending on the information you have (Do you know the approximate position of the cell? If not, do you at least know some unique content of it?) reading the current cell height will include some guesswork and much coding because unfortunately the iText parser framework does not yet support parsing path operations.
Essentially you have to enhance the classes in the PDF parser package to also process and emit events for PDF path operators (if you know your way around in iText and the PDF specification that should not take more than a week or two) and create an appropriate event listener to find the lines surrounding the cell position you already know (not more than one day of work). Some iText code analysis will show how the fixed cell height and the distance of the surrounding lines relate.
Most likely, though, this is the smaller part of your work. The bigger part is actually manipulating the page content:
If you are lucky, all your page content is located in a single content stream. In that case you merely have to analyse all the page content again but this time to actually change it. The easiest way would be to enhance the classes in the parser package once again (because they already do much of the necessary math and book-keeping) to signal every command from the content stream with normalized coordinates (this might take a week or two). Based on this information signaled to you built an all new content stream in which you leave everything above your cell, move down everything below, and stretch everything crossing the line on which the bottom border of your cell lies (another week maybe).
If you are less lucky you have to fight with multiple included form xobjects crossing the line. As those xobjects may be used from other streams also, you cannot change them but have to either change a copy or include the xobject content in your newly created stream.
Then what about images crossing the line? or interesting patterns? In that case stretching the cell will utterly distort everything.
And then there are annotations, e.g. your form fields. You need to shift and stretch them, too.
Thus, while this approach is possible to follow, please be aware that (depending on how generic the solution has to become) its implementation will take someone knowing iText and PDF some months.
An alternative approach
You say in a comment
I am working on Pdf Form.I have created itext form using TextField(MULTILINE TEXT) once. After read this pdf and fill up the form but when the content increases it shows scroll Bar and content hide. My problem is Once i print the pdf it did't print hide content.
Why don't you simply for each set of data build an individual PDF with all the cells big enough for the form contents of the respective data set and copy the field values into this new PDF. This is a fairly simple approach, yet flexible enough to not waste too much space but at the same time not hide content.
I would like to convert a string of text into an image. The issue is, I want the text to wrap if it is wider than the length of the image, and the height of the image to be dynamically sized to perfectly fit the text, so that I know how much space the text takes up.
I'm working in Java and there are several things I have tried:
Rendering HTML in a JPanel and saving as a BufferedImage. The problem here was that most of the css I used was ignored by the JPanel and the image was unusable.
Using ImageMagick and img4Java. The two big failures with this solution was that I needed the command-line tool installed, which I can't do on our server. The second was that I couldn't easily convert the image to buffered image for use in the rest of the app.
Does anyone know a way to do this in Java?
Thanks!
In this example, an arbitrary panel is rendered into a BufferedImage and displayed in an adjacent panel at half-scale. The example uses a grid of labels, but you can use the wrap feature of JTextArea or the geometry supplied by TextLayout, examined here.
You might use a label containing HTML for the line-wrap, as shown here.
To get an image of that, see LabelRenderTest.
When an image is placed in a word 2007 document with text wrapping other than 'inline', the position of the image with respect to text is not reflected in the document.xml. Only I am able to get the horizontal and vertical position offset from column and paragraph. I am not able to figure out whether the image comes in between two words of text or after/before the words. Is there a way to know that, suppose I want to represent the document in html? I am using sax parser and some part of Apache-poi to parse the .docx. Help is appreciated if anyone is conversant with these technologies.