Apache fop : Unable to handle if single Word in text is larger than the containing block - apache-fop

I am new to fop , will be greatful if i get help from someone...,
I am not using XSLT tranformation but creating XSLFO file directly using Java code. Everything works fine but the problem comes when particular word(long text without space) is inserted into a cell of a table-column . That bigger word is overlapping the successive block.
I have an fo:block element in fo:table-cell which is in fo:table-row of a fo:table. This table has 6 columns, obviously column width is small. Now, when a Word in the block is larger than the block it is overlapping the next block. Give me some attribute value or any other solution to change my XSLFO file ,so that the bigger word breaks into the new line at end of the column.
Thanks in advance...

The things you need to look into are:
For the fo:table-cell: number-columns-spanned="3"
For setting the width of fo:table-column: column-width="proportional-column-width(1.5)"
The number-columns-spanned is used as attribute of and provides you with a means to select a bigger area where your fo:block fits.
The column-width makes it easy to define absolute width or, when using proportional-column-width, a width relative to the other columns.
I don't know of a way that lets FOP break words into multiple parts when they don't fit.

Related

Dynamically create textbox rotated by 180 degrees

I would like to create a Word document with multiple text boxes that serve as name badges. Each name appears twice, once set normally and once rotated by 180 degrees. Later, they are printed on paper, cut and folded, so they can stand on a table.
I am using docx4j to generate the DOCX file. My idea is to have a fragment in one Word file that serves as a template for a single name badge. I'd like to load that template and fill the placeholders with real names. Multiple fragments are then concatenated and written to a second Word template, so ultimately I have a list with multiple name badges. The paper I use allows two name badges on each page (i.e. four text boxes).
However, I fail implementing this with docxj4. This is what I tried:
(1) First, I tried filling a single name badge. The placeholders got filled correctly, but the rotated text box of my Word template (input) became an ordinary (not rotated) text box in the output file.
(2) I also tried MainDocumentPart#addParagraph(String) and created the entire paragraph myself, using XML code generated in Word (where the text box was rotated). The output generated by docx4j, however, again did not respect the rotation. It created two text boxes, but when I view them in Word now, I even cannot rotate them there anymore. It seems like the generated text boxes are different from those created by Word in the first place.
Long story short, how can I create a rotated text box with docx4j?
It would be very convenient, if I could have a Word template to layout the name badges, but if I would have to create the entire thing programatically, it would be fine, too. Also, other ways of rotating text would be okay for me. But it seems like text boxes are the only objects in Word that can actually be rotated by 180 degrees.

EvoPdf convert large Html table use too much RAM

I have a Html file which is roughly 4.3MB contains a table with 6 columns and 10k rows. Each cell contains 1-10 characters, has only "class" attribute for its style which is very simple (font family, font size, text color and cell color).
I converted this file to Pdf but EvoPdf used almost 11GB RAM (I built my project to run on 64bit) and crashed my IIS but didn't return any result. I tried with fewer row (5k) and EvoPdf did return result but still use a lot memory. And the result is almost 150MB.
I don't know I did anything wrong there.
And for my settings, I use repeat table header and embed font.
Can someone help me?
Thank you.

Way to preserve formatting for lists when copy / pasting from table cell?

My Word interop application needs to get content out of a cell of a table in a word document. The problem is, that the formatting for some items seems broken. For example the last item of a list does not have the list style applyied. Headings are only normal text etc.
The same happens if you create a table, create a list in the table and try to copy / paste the list to somewhere else.
Has anyone else had this problem and maybe found a solution? Is there any way to trick word into giving the correct formatting?
Thanks in advance
Example code
Range range = cell.range;
range.MoveEnd(WdUnits.wdCharacter, -1);
...
range.FormattedText.copy()
The range includes the end-of-cell marker which should not be exported. I just noticed, when not altering the range, list are correctly formatted but the whole cell is exported as a table, which is bad because i want to import the content into another document (where this would nest tables infinitly)
Word2010 v14.06.6112.5000

How can one tell if a field has wrapped in Crystal Reports 2008?

In Crystal Reports 2008, I need to have an accurate count of all of the lines that have been displayed in a sub report.
I'm using a shared variable and incrementing as needed when lines display. The only problem I'm having now is when a field wraps. We are not using a fixed width font, so going by field length does not solve the issue, as 'i' is not as wide as 'w' and so on.
Is there a way to find out if the data in a field will be wrapped, and if so how many lines it wraps to, or is there a way to find out what the height of the section that the field is in (or the field itself) has grown too?
Or, is there an even better way to count how many lines have actually displayed on the sub report?
No, there is no way to do what you describe.
If you used a fixed-width font, you could then do some math based based on "it wraps at X characters" do if length of string is 100, then it went 2 lines, etc.

How can we set an equal spacing between two labels where contents dynamically loaded in iphone SDK

In my iphone app, i have a requirement for quote of the day.
I want to display the quote in the manner as quote and its author name.
I want that no matter how big or how small the quote is the author name should come below the quote leaving one blank line.
I tried using the two labels but it works well for bigger quotes but for small quotes the author name seems too far away from the quote.
I want equal spacing between quote and author name no matter how big or small the quote is.
What should I do?
Please Help and suggest.
Your suggestions are most welcome
Thanks
Why don't you size the text dynamically using size and constraint and depending on them create/set the two frames needed for the two labels? See this basic example:
http://www.cimgf.com/2009/09/23/uitableviewcell-dynamic-height/