Related
There are three QGraphicsView in one line. If these QGraphicsView is vertically located (orientation is 0), to select texts with mouse is no problem. But if these QGrahpicsView is horizontally located, goes bad.Even if horizontally located, I must select texts vertically.
It seems that the mouse point at the time of mouse press event is decided by QTextEdit coordinate at first.
At the time of mouse move event, the mouse point is decided by the position of mouse press event as the anchor.
So is the time of mouse release event.
Is there way to select texts with mouse naturally? Or does Qt allow us to select texts with mouse vertically only?
from PySide6.QtWidgets import QApplication, QGraphicsView, QGraphicsScene, QGraphicsProxyWidget, QTextEdit
from PySide6.QtGui import QTextDocument, QPageSize, QPainter, QBrush, QTextCharFormat, QTextOption
from PySide6.QtCore import Qt, Signal, QRect, QRectF, QEvent, QSize, QSizeF, QPointF
class MainGraphicsView(QGraphicsView):
def __init__(self, parent=None):
super(MainGraphicsView, self).__init__(parent)
self._mainscene = MainGraphicsScene(1)
self._mainscene._mainview = self
self.setScene(self._mainscene)
class MainGraphicsScene(QGraphicsScene):
def __init__(self, orientation = 1, parent=None):
super(MainGraphicsScene, self).__init__(parent)
if orientation == 0:
self.rootView = TextGraphicsView()
self.rootView.main_scene = self
self.root_proxywidget = self.addWidget(self.rootView)
self.rootView.setSceneRect(0, 0, self.document()._pageWidth, self.document()._pageHeight)
self.secondaryView = SecondaryTextGraphicsView(2, self.rootView.scene())
self.secondaryView.setSceneRect(0, self.document()._pageHeight, self.document()._pageWidth, self.document()._pageHeight)
self.secondary_proxywidget = self.addWidget(self.secondaryView)
self.secondary_proxywidget.setPos(0, self.document()._pageHeight)
self.thirdView = SecondaryTextGraphicsView(3, self.rootView.scene())
self.thirdView.setSceneRect(0, self.document()._pageHeight*2, self.document()._pageWidth, self.document()._pageHeight)
self.third_proxywidget = self.addWidget(self.thirdView)
self.third_proxywidget.setPos(0, self.document()._pageHeight*2)
if orientation == 1:
self.rootView = TextGraphicsView()
self.rootView.main_scene = self
self.root_proxywidget = self.addWidget(self.rootView)
self.rootView.setSceneRect(0, 0, self.document()._pageWidth, self.document()._pageHeight)
self.secondaryView = SecondaryTextGraphicsView(2, self.rootView.scene())
self.secondaryView.setSceneRect(0, self.document()._pageHeight, self.document()._pageWidth, self.document()._pageHeight)
self.secondary_proxywidget = self.addWidget(self.secondaryView)
self.secondary_proxywidget.setPos(self.document()._pageWidth, 0)
self.thirdView = SecondaryTextGraphicsView(3, self.rootView.scene())
self.thirdView.setSceneRect(0, self.document()._pageHeight*2, self.document()._pageWidth, self.document()._pageHeight)
self.third_proxywidget = self.addWidget(self.thirdView)
self.third_proxywidget.setPos(self.document()._pageWidth*2, 0)
self.setBackgroundBrush(QBrush(Qt.gray))
def view(self):
return self._mainview
def textedit(self):
return self.document().parent()
def document(self):
return self.rootView.document()
class TextGraphicsView(QGraphicsView):
def __init__(self, parent=None):
super().__init__(parent)
self.page = 1
self.initScene()
def mousePressEvent(self, event):
SecondaryTextGraphicsView.selectedPage = self.page
return QGraphicsView.mousePressEvent(self, event)
def initScene(self):
self.common_scene = TextGraphicsScene()
self.common_scene.root_view = self
self.setScene(self.common_scene)
self.setSceneRect(0, self.document()._pageHeight*(self.page -1), self.document()._pageWidth, self.document()._pageHeight)
self.resize(int(self.document()._pageWidth), int(self.document()._pageHeight))
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
def view(self):
return self.main_scene._mainview
def textedit(self):
return self.common_scene.textedit
def document(self):
return self.common_scene.textedit.document()
class SecondaryTextGraphicsView(QGraphicsView):
def __init__(self, page, scene, parent=None):
super().__init__(scene, parent)
self.page = page
self.initScene()
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
def initScene(self):
self.setSceneRect(0, self.document()._pageHeight*(self.page-1), self.document()._pageWidth, self.document()._pageHeight)
self.resize(int(self.document()._pageWidth), int(self.document()._pageHeight))
def view(self):
return self.scene().root_view.view()
def textedit(self):
return self.scene().textedit()
def document(self):
return self.scene().textedit.document()
class TextGraphicsScene(QGraphicsScene):
def __init__(self, parent=None):
super().__init__(parent)
self.textedit = TextEdit(scene=self)
self.addWidget(self.textedit)
def view(self):
return self.root_view
def document(self):
return self.textedit.document()
class TextEdit(QTextEdit):
def __init__(self, scene, parent=None):
super().__init__(parent)
self.setAttribute(Qt.WA_InputMethodEnabled, True)
self.setMouseTracking(False)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scene = scene
self.setDocument(TextDocument(parent=self))
self.setWordWrapMode(QTextOption.WrapAtWordBoundaryOrAnywhere)
self.setLineWrapMode(self.LineWrapMode.FixedPixelWidth)
self.setLineWrapColumnOrWidth(self.document()._pageWidth)
self.setAttribute(Qt.WA_InputMethodEnabled, True)
self.setInputMethodHints(Qt.ImhMultiLine)
self.resize(self.document()._pageSize.toSize().width(), self.document()._pageSize.toSize().height()*3)
self.setPlainText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\
Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\
Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\
Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\
Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\
Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\
Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\
Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\
\Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\
Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\
Lorem ipsum dolor sit amet, consectetur adipiscing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")
def mouseMoveEvent(self, event):
print(event.position())
return QTextEdit.mouseMoveEvent(self, event)
def view(self):
return self.scene.root_view
def pageSize(self):
return self.document()._pageSize
class TextDocument(QTextDocument):
def __init__(self, parent=None):
super().__init__(parent)
self._pageSize = QPageSize.size(QPageSize.A4, QPageSize.Point)
self._pageHeight = self._pageSize.height()
self._pageWidth = self._pageSize.width()
self.setDocumentMargin(30.5)
def main():
import sys
app = QApplication([]) if QApplication.instance() is None else QApplication.instance()
m = MainGraphicsView()
m.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()
from your comment:
if I use QGraphicsView and shows the each page, I don't have to calculate the position of QTextLines when the document is horizontally layouted. QGraphicsView can show each page horizontally, but in actual QTextEdit is all vertically layouted. That is why it is very simple.
You need not to draw the lines on the basis of QTextLayout.
QTextLine also has draw method.
Please use QTextLine instead of QTextLayout.
QTextLine draw
I'm having trouble understanding why the two chunks of HTML below render differently. The yellow and pink table is missing a BR tag, and flows efficiently, the green and blue table has the <BR> tag in the middle of the text in the blue cell, and has unwanted space in the green cell. I've tried rendering as flex boxes and tables, and they render the same way. I've tried different browsers, and they render the same way.
What rule is being followed in the green and blue layout that causes the whitespace in the green cell?
How can I get rendering like the yellow-and-pink case and use <BR> tags? I'm actually after <P> tags, but let's just talk about <BR> tags, which I figure are the most simple case.
<html><body>
<div style="display: flex; flex-flow: row;">
<div style="background-color: green;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
<div style="background-color: blue;">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
<br/>
Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?
</div>
</div>
<br/>
<table>
<tr>
<td style="background-color: yellow;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</td>
<td style="background-color: pink;">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
<xbr/>
Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?
</td>
</table>
<br/>
</body></html>
Screenshot:
If a height is assigned to a div, the whitespace is not removed (see the darker green below), and if a <br> tag is allowed into a table which has a height on the cell, the whitespace is split between the top and bottom of the cell (see the lighter green below) - but the height attribute doesn't affect the rendering anyway:
This behaviour is exhibited in FireFox 80.0 and Chrome Version 85.0.4183.83
Here's what's going on:
Inside of the div with display: flex; flex-flow: row you have two children, the green and the blue divs.
The browser calculates their individual widths (it's the width because flex-flow: row) as follows:
The calculation of the green div's width is straight forward. It's the width of the whole text on one line.
=> greenWidth
The calculation of the blue div is a little bit more involved because of the <br>. This causes the text to be split in two. The browser then calculates the widths of these two bits of text that they would take on one line each. Then it takes the wider of these.
=> blueWidth
Both, the green and the blue box have their default value for flex-basis which is auto. For the green box, the browser takes greenWidth and for the blue box it takes blueWidth as the result of auto.
I still haven't come up with an actual solution but maybe, based on the above, you might be able to figure something out.
In the flex-box the items are stretched to the height of the container (if height of items is not defined). However, You can change this behaviour by gibing the green div a height.
Suppose the height is 100px;
<html><body>
<div style="display: flex; flex-flow: row;">
<div style="background-color: green; height: 100px;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
<div style="background-color: blue;">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque
laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi
architecto beatae vitae dicta sunt explicabo.
<br/>
Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci
velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam
aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem
ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?
</div>
</div>
<br/>
<table>
<tr>
<td style="background-color: yellow;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</td>
<td style="background-color: pink;">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque
laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi
architecto beatae vitae dicta sunt explicabo.
<xbr/>
Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci
velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam
aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem
ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?
</td>
</tr>
</table>
<br/>
</body></html>
Christian pointed in the right direction. Understanding that the problem is down to sizing being affected by tags, I allowed the browser to size the un-tagged content, but hid its rendering.
The "solution" is to have two text bodies, one rendering with tags and the other without. The text without tags is color:transparent; and positioned with normal text flow. The text with tags is rendered on top of the document text flow in the location of the transparent text by using a z-index higher than the normal text. There is a chance that the text with tags will overflow the table, so layout your page with this possibility under consideration (or pad the text without tags a little):
<html><body>
<div style="display: flex; flex-flow: row;">
<div style="background-color: #FFA;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
<div style="position: relative; background-color: #FDD;">
<div style="position: absolute; z-index:2;">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
<br/>
Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?
</div>
<div style="color:transparent;">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
<xbr/>
Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?
</div>
</div>
</div>
</body></html>
It's possible to create a v-list in vuetify with fixed height and when my user add some content he show a scrollbar in the v-list
tks
What your asking is not entirely clear, but with CSS you can add a scroll bar to a card if its not automatic.
Here is the codepen:
https://codepen.io/AleaQ/pen/WJZqWb
<div id="app">
<v-app id="inspire">
<v-container fluid>
<v-layout>
<v-flex xs6>
<v-card class="scroll" height="100">
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</v-card>
</v-flex>
</v-layout>
</v-container>
</v-app>
</div>
//CSS MARKUP
.scroll {
overflow-y: auto;
}
I'm generating a very basic PDF with header and footer like this:
<cfdocument format="PDF" pagetype="A4" unit="cm" scale="100">
<cfset template_stlye = fileRead(expandPath('love.css'))>
<cfdocumentitem type="header" evalatprint="true">
<cfif cfdocument.currentpagenumber eq 1>
<style type="text/css" media="screen">
<cfoutput>
#template_stlye#
</cfoutput>
</style>
<div class="pdf_header">
<div class="header_text">
I'm a lovely header
</div>
</div>
</cfif>
</cfdocumentitem>
<cfdocumentitem type="footer" evalatprint="true">
<cfif cfdocument.currentpagenumber eq 1>
<style type="text/css" media="screen">
<cfoutput>
#template_stlye#
</cfoutput>
</style>
<div class="pdf_footer">
<div class="footer_text">
I'm a lovely footer
</div>
</div>
</cfif>
</cfdocumentitem>
<style type="text/css" media="screen">
<cfoutput>
#template_stlye#
</cfoutput>
</style>
<div class="pdf_content">
<h1>Foo bar</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus dictum egestas lorem sed ultricies. Aliquam in orci eu massa semper tempor ac at nisi. Proin vestibulum dictum rhoncus. Mauris blandit congue auctor. Vestibulum sed fermentum nibh. Donec non nibh risus. Mauris vestibulum magna libero. Pellentesque vel lectus congue, eleifend sapien id, porttitor tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus eget imperdiet eros, in congue massa. Curabitur eget massa aliquam, rhoncus ipsum vitae, rhoncus felis. Integer a aliquet sapien. Donec lacinia sem sed turpis pellentesque ultrices.
</p>
<p>
Aenean eget magna sodales eros ullamcorper consectetur. Maecenas varius est ac rhoncus gravida. Donec posuere rhoncus massa nec suscipit. Nullam vestibulum nunc quis nisi pharetra dignissim. Maecenas lobortis placerat sapien porta cursus. Pellentesque aliquet a massa id sodales. Curabitur massa felis, pellentesque volutpat molestie vel, mollis sit amet purus. Donec faucibus felis ut neque tristique vulputate. Phasellus facilisis lectus ac vestibulum vulputate. Vivamus quis convallis nibh. Pellentesque commodo dolor et velit volutpat ultricies. Vestibulum pharetra at nulla a pulvinar. Donec non rhoncus justo. Sed tempus, tellus sed consequat dictum, est lectus ultrices ante, a sagittis urna eros non lorem. Fusce quis sagittis diam, quis sollicitudin leo. Nulla ut dolor iaculis, fermentum turpis eu, fringilla tellus.
</p>
</div>
</cfdocument>
The CSS file:
.pdf_content {
font-size: 11pt;
font-family: Arial, Tahoma;
}
.header_text, .footer_text {
font-size: 10pt;
font-family: Arial, Tahoma;
line-height: 9pt;
text-align: center;
}
.pdf_header, .pdf_footer {
position: absolute;
top: 0.5cm;
width: 18cm;
}
And I end up with the regular content in a wrong scale:
While it's supposed to look like this:
Any idea, why this is happening?
I'm working with:
Windows 10, Version 1511, Build 10586.164
Coldfusion 10.0.20.283922, Tomcat 7.0.68.0
After some debugging efforts and further comparison with a co-workers setup we found out that the included Java version is so old that it doesn't even know Windows 10.
Settings before:
After pointing ColdFusion the the most recent JDK it worked.
Settings after:
PS: "fun fact" when changing back to the included Java version the scaling issue wasn't reproducible anymore. wtf
I've used the previous version of Bootstrap and had no problem with this, but I'm trying with 3.0 and my classes just lie on top of each other rather than floating from keft to right, what am I doing wrong?
I followed this tutorial http://www.w3resource.com/twitter-bootstrap/grid-system-tutorial.php and even copied it across as it was driving me insane, but it didn't even work.
This is my current HTML
<!DOCTYPE html>
<html>
<head>
<title>Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="./css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="./css/global.css" rel="stylesheet" media="screen">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<nav class="navbar" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#emproium-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Branding</a>
</div>
<div class="collapse navbar-collapse" id="emproium-navbar-collapse">
<ul class="nav navbar-nav">
<li>Core Collection</li>
<li>Antiques</li>
<li>Art</li>
<li>Furniture</li>
<li class="dropdown">
Home Decor <b class="caret"></b>
<ul class="dropdown-menu">
<li>Rugs</li>
<li>Throws</li>
<li>Quilts</li>
<li>Accent Pillows</li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
<li>Cart</li>
<li>Contact</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
<div class="banner span12">
</div>
<div class="tile span4"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, condimentum at, laoreet mattis, massa. Sed eleifend nonummy diam. Praesent mauris ante, elementum et, bibendum at, posuere sit amet, nibh. Duis tincidunt lectus quis dui viverra vestibulum. Suspendisse vulputate aliquam dui. Nulla elementum dui ut augue. Aliquam vehicula mi at mauris. Maecenas placerat, nisl at consequat rhoncus, sem nunc gravida justo, quis eleifend arcu velit quis lacus. Morbi magna magna, tincidunt a, mattis non, imperdiet vitae, tellus. Sed odio est, auctor ac, sollicitudin in, consequat vitae, orci. Fusce id felis. Vivamus sollicitudin metus eget eros.</p></div>
<div class="tile span4"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, condimentum at, laoreet mattis, massa. Sed eleifend nonummy diam. Praesent mauris ante, elementum et, bibendum at, posuere sit amet, nibh. Duis tincidunt lectus quis dui viverra vestibulum. Suspendisse vulputate aliquam dui. Nulla elementum dui ut augue. Aliquam vehicula mi at mauris. Maecenas placerat, nisl at consequat rhoncus, sem nunc gravida justo, quis eleifend arcu velit quis lacus. Morbi magna magna, tincidunt a, mattis non, imperdiet vitae, tellus. Sed odio est, auctor ac, sollicitudin in, consequat vitae, orci. Fusce id felis. Vivamus sollicitudin metus eget eros.</p></div>
<div class="tile span4"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, condimentum at, laoreet mattis, massa. Sed eleifend nonummy diam. Praesent mauris ante, elementum et, bibendum at, posuere sit amet, nibh. Duis tincidunt lectus quis dui viverra vestibulum. Suspendisse vulputate aliquam dui. Nulla elementum dui ut augue. Aliquam vehicula mi at mauris. Maecenas placerat, nisl at consequat rhoncus, sem nunc gravida justo, quis eleifend arcu velit quis lacus. Morbi magna magna, tincidunt a, mattis non, imperdiet vitae, tellus. Sed odio est, auctor ac, sollicitudin in, consequat vitae, orci. Fusce id felis. Vivamus sollicitudin metus eget eros.</p></div>
</div><!-- end of row-->
</div><!-- container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://code.jquery.com/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="./js/bootstrap.min.js"></script>
That's my full code, if anyone could point out what is wrong here i'd be grateful. I'm sure it's pretty simple.
Jonny
span* have been replaced by the col-xs|sm|md|lg-* naming convention. Just looking at your code, that is probably your main issue in migrating to BS3. See http://getbootstrap.com/getting-started/#migration for a full list of what has changed.