In a block I have a text. I have some trouble with the linefeedtreatment.
<fo:block>
<xsl:value-of select="text"/>
</fo:block>
The text Shows like this:
Master II Phase 1, Pha-
se 2, Phase 3
Must look like this:
Master II Phase 1,
Phase 2, Phase 3
I've tried "Keep-together.within-line" and "linefeed-treatment" but without any result.
You appear to have hyphenation enabled when you don't want it to be. Presumably your FO contains hyphenate="true" on some ancestor FO. See https://www.w3.org/TR/xsl11/#hyphenate
Add hyphenate="false" to the fo:block to disable hyphenation of the text in the block.
The other possibility is that you have soft-hyphen characters in your text. If hyphenate="false" doesn't solve the problem, please edit your question to add the XML for the text element that has the problem.
Related
I want to align a paragraph below in XSL fO.
Label : value
Be careful not to set the heap size too large, as whatever
you allocate reduces the amount of memory available to the
operating system and other programs, which could cause
excessive paging (memory swapped back and forth between
RAM and the swap disc, which will slow your system down)
with proper alignment and indentation. Am able to create with word-breaks but indentation is missing .can anyone suggest the solution
Think you something like this?
<fo:block text-align="justify" margin-left="1.5cm">Your text here ...</fo:block>
Or you can use linefeed-treatment white-space-treatment, whitespace-collapse attributes together for preformatted texts.
And you can drop the fo:block into a fo:block-container for background coloring and bordering.
<fo:block margin-left="5mm" margin-right="5mm"
font-family="verdana" font-size="12pt"
space-before="5mm" space-after="5mm" keep-together="always"
linefeed-treatment="preserve" whitespace-treatment="pre" whitespace-collapse="false">
Your multiline
code here,
and more lines,
with multiple spaces on start and within
and empty lines ...
</fo:block>
I want my first line at the top of the console to look like this:
, but mine looks like this, and it's long:
How can I shorten it to like the first picture?
I'm watching Java tutorials on youtube and their first lines ("C:\programs Files\Java\jdk\whatever"...) are always so short and pretty with 3 cute dots in the end, but mine is long and annoying.
You can define the lines which should be folded:
Right click on that line in the console
Choose "Fold Lines Like This"
Click OK
You can also define special keywords/phrases in this menu, where lines, which contains the phrase will be folded with ellipsis (...) at the end.
See the ConsoleViewImpl.java file in the source code of IntelliJ IDEA
This line (execution command) will be automatically hidden in case the string length is more than 1000 symbols.
So, once you add something to the execution command (for example by adding libraries), the execution command is folded automatically.
As the title states, I am currently struggling to force line-breaks ("\n" respectively "\r\n") in a pdf-acro-field. I am using OpenPdf and FlyingSaucer (see dependencies for details) and managed to enable multi-line and rich-text of fields by setting the bit-flags 13 and 26 of the "Ff" property.
I was using the PDF-Reference ISO-3200_2008 as a guide (starting on page 442).https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf
Issue
I read an existing PDF and fill the acro fields programmatically. Something like this:
acroFields.setField("address", content);
The content is just a simple string with some newline characters. Nothing special.
My text is too long and will have to break at some point. When multiline is enabled, the text will break, but only if it reaches the end of the line. Basically, what I want to display is something like an address and some additional information on top. But not all lines are equal in size and for example I want to have information 1 and 2 on the same line and info 4 and 5 each on separate lines.
What I had in mind
<h2>What I want</h2>
<pre>Company XYZ
A brand here</pre>
<pre>Another Section
With some more info that goes further to the right
phone, email, website</pre>
<br>
<h2>What it looks like</h2>
<p>Company XYZ
A brand here
Another Section
With some more info that goes further to the right
phone, email, website</p>
Questions
Is there a way to implement line-breaks in PDF in general?
Is there a way to implement line-breaks programmatically?
Can I do this in OpenPdf or FlyingSaucer?
If there is no simple way - what would be a viable workaround?
Dependencies
compile group: 'com.github.librepdf', name: 'openpdf', version: '1.3.3'
compile group: 'com.googlecode.juniversalchardet', name: 'juniversalchardet', version: '1.0.3'
compile 'org.xhtmlrenderer:flying-saucer-core:9.1.18'
compile 'org.xhtmlrenderer:flying-saucer-pdf-openpdf:9.1.18'
It did not work, because the content (input coming from parsed html file) had \r\n in it, but somehow it does only work with \n so I did the following:
content.replaceAll("\\\\r\\\\n", Chunk.NEWLINE.getContent()); // 2nd param is just "\n"
This fixed my issue.
I use the taglib sharp library to remove all tags from my songs with the command
Track = TagLib.File.Create("C:\test\Super Trouper.mp3")
Track.RemoveTags(TagLib.TagTypes.AllTags)
Track.Save()
Track.Dispose()
Unfortunately, the .RemoveTags doesn't remove a Lyrics3 v2.0 tag
(specified here: http://id3.org/Lyrics3v2).
Such a tag can be detected with a tool like "Mp3 Diags" (http://mp3diags.sourceforge.net/)
How can I completely remove ALL tags and ALL frames from my song?
Or how can I remove this specific Lyrics3 v2 tag?
Unfortunately, TagLib# doesn't support Lyrics3 tags. In an MP3 file, TagLib# will detect and can remove only APE, Id3v1, and Id3v2 tags.
After saving the file with tags removed by TagLib#, you could do something like the following with your own code:
Open a file stream.
Seek to Length - 9, read 9 bytes and see if they equal LYRICS200 or LYRICSEND. If not, close the file.
Seeking back 11 bytes.
Reading 11 bytes and checking if they match LYRICSBEGIN. If so, truncate the file at that point.
If not, keep seeking back 1 byte and repeating step 4. Probably give up after 10KB or so.
This is not the most efficient strategy but I'm imagining the number of files with these tags is quite low so most should stop after step 2.
Is it possible without any code modification? Making a tab would insert 4 spaces, but in editor it would look like 2. I think it might be useful to display code from different libraries with the same indent size.
No. How could 4 spaces could look like 2? Only a Tab can look like any number of spaces.