I am trying to get MPDF to correctly print divs with overflow:hidden. I've read their documentation up and down and tried various things. No luck. Per mpdf, block elements with overflow:hidden must have position:absolute or position:fixed set. That is fine when you printing just one div. The issue comes up when i try to nest divs and need the inner one to clip text. Here's what I mean:
This prints out fine
$html = <<< EOM
<div style='width:300px;height:100px;position:absolute;overflow:hidden;border:1px solid black;'>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
$html = <<< EOM
This does not
$html = <<< EOM
<div style='border:1px solid red;position:relative;'>
<div style='width:300px;height:100px;position:absolute;overflow:hidden;border:1px solid black;'>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</div>
$html = <<< EOM
The php script is simple
include("mpdf.php");
$mpdf=new mPDF();
$mpdf->WriteHTML($html);
$mpdf->Output();
As you can see the only difference is that one div is inside another one. Has anyone figured out how to do this?
In mpdf you can't use overflow: hidden; on nested divs. overflow: hidden; can only be used on top level elements.
Related
Using ckeditor4 in an Angular 1.6 webapp. Works fine but when enabling SCAYT the whole app/ckeditor get sluggish if you run it on IE11 or Edge. It works quite ok when running in Chrome.
Can be easily reproduced on https://ckeditor.com/ckeditor-4/#document
Use https://www.lipsum.com/ to generate 20 000 bytes of text which really isn't that much and paste it in the editor. Then enable SCAYT, and you will see Edge increasing CPU to 19% and memory alternating from 250 to 340 MB. Try adding some more text to the editor - it is almost impossible.
Any tricks to support SCAYT in IE11 and Edge for CKEditor4?
Any other plugin to recommend?
SCAYT tool checks text by small portions up to 10 words at a time. The larger the document the more time is needed for processing. However, SCAYT shouldn't have affected or blocked the work of CKEditor (adding more text, etc.).
We are able to reproduce the problem with SCAYT performance in IE/Edge using your steps and sample Lorem ipsum text. In your case, the root cause of the SCAYT performance issue is not only the size of the text but and the percentage of misspelled words in this text. For Lorem ipsum text, it is about 99% percent of words that are incorrect, which SCAYT detects and underlines (marks) as incorrect.
If you try to use any real text (even with number of errors) instead of Lorem ipsum, you shouldn't have such dramatic increase of CPU utilization or memory consumption.
Alternatively, you may consider trying another spellcheck plugin provided along with SCAYT in CKEditor – WebSpellChecker Dialog. It is also available under ABC button –> Spell Checking. It is designed to check the large pieces of text at once (in a separate window).
Hope this helps.
I'm looking for a very simple Bookmarklet which presents me with some Lipsum text. The ones I've seen generally make requests to a generator - but I want one which I can use offline (how often does Lorum Ipsum text change..?!).
Has anyone got any suggestions? It'd be nice to be able to specify how many paragraphs I want.
I've written this Bookmarklet. I've only tested in Firefox - it's simple, but meets my requirements. I don't have a Blog, so I thought I'd share it on Stack instead!
(though, I can't post the bookmarklet itself on Stack, so please see attached fiddle... also, the code is bodged together and not tidied up, but, it's functional for my need!)
.
I'm working on a small bash tutorial for a programming course. I would like to alternate between explanations for the commands and images as below
Lorem ipsum dolor sit amet..
Lorem ipsum dolor sit amet...
I would like to automatically generate these images given a list of commands as doing it manually would be very tedious. Going from a screenshot to a cropped image is the easy part, I'm looking for solutions for the "commands => screenshots" part.
For example, these two images could be generated from the following "instructions" :
clear
ls
saveas "img1.png"
clear
mkdir example
ls
saveas "img2.png"
I've looked at http://ascii.io/docs/about and I was thinking of using a similar technique : a python script would be reading the "instructions" and feed them to a subprocessed shell and would be calling a screenshot utility when needed.
Am I trying to reinvent the wheel ? Is there a tool that could be used to generate these kind of images ? Or a simplest way to achieve my goal ?
ImageMagick's import can be used to capture window images using -window. Simply hide the menu, toolbar, tabbar, and scrollbar in the terminal before using. Use xwininfo(1) to get the window ID.
$ import -window 0x145cba2 terminal.png
I have ZPL code as follows:
^XA^CI27^LH0,0^BY2^FO250,50^B3N,N,25,N,N^FDU0772287 ^FS
^FO30,50^A0N,35,35^FD$9.99 ^FS
^FO200,80^A0N,25,25^FH^FDBatch 14657, Item 772287K, 2013-May-29 ^FS
^FO30,115^A0N,25,25^FH^FDAccessories for stroller/carseat, Acton ^FS
^FO550,145^A0N,25,25^FH^FDSize: Preschool ^FS
^FO30,145^A0N,25,25^FH^FDDenim, Maternity ^FS^XZ
When sending it to my Zebra GK420d via POS for .NET & Zebra OPOS, this label ends up taking two 4 inch x 1 inch labels instead of just one. Only one line prints on the second label. There is more than enough room on the label to print this text.
Remove the ^CI27 and the ^FH and you will not see this behaviour.
Remove almost any one of the individual pieces of text and you will not see this behaviour.
Change the label at 200,80 to start at 30,80 and you won't see this behaviour.
Change Acton to say Act and you won't see this behaviour.
However, in some of the above scenarios, although it prints on one label, you'll sometimes discover a ^FS appear somewhere, in the standard font (smaller than ^A0N,25,25). In the last variant (and a bunch of others), you'll end up with the end of one of the lines of text written, in the default font, overwriting the start of another line. You'll also sometimes see a ^FS appear in the middle of nowhere.
Because I see this bug with only some textual strings and not others, I suspected some kind of layout bug due to font size calculations, so I tried changing all the text on the label to a W or an I and it does not make any difference.
I'm stumped; this makes no sense to me and it doesn't follow the documentation I have seen online. Furthermore, everything explodes (fonts are ignored, text is overwritten, prints on four stickers, etc.) when:
a linebreak (Windows) is not put after every ^FS
a linebreak is put anywhere else
a space is not put before every ^FS
Do I have a bug in my ZPL? Am I finding a weird bug in the Zebra OPOS library or POS for .NET? Is it just my printer?
i 'mstuck in one problem Drag-able list items.... i want to arrange my list with drag option
I'm building an app that makes heavy use of lists and I can't seem to find any way to make list items re-orderable by drag and drop. Am I missing something or is there simply no way to do this?
suppose
1.lorem ipsum aa
2.lorem ipsum bb
3.lorem ipsum cc
4.lorem ipsum rr
5.lorem ipsum ee
drag 2nd list item and set it to 4th ... i know this is easily possible in iphone but is there any option in enyo?
Any help would be greatly appreciated :)
thanks for your valuable time.
In the 1.0 release, the Enyo framework doesn't have reorderable lists.
Somebody on the WebOs development forums actually created a reorder-able list with enyo and released the code. See - https://developer.palm.com/distribution/viewtopic.php?f=11&t=15850