How do I increase the dimensions of pages in PDFs that I have created using the program Prince? - princexml

Prince uses a CSS file to set the properties of the PDFs it generates. I have tried adding the commands body {height: 1536; width: 1024} to the CSS file for which I received the prince error:
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/15. drug therapy of depression and anxiety disorders.htm:32: error: Unexpected end tag : table
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/15. drug therapy of depression and anxiety disorders.htm:33: error: Unexpected end tag : td
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/15. drug therapy of depression and anxiety disorders.htm:35: error: Unexpected end tag : tr
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/15. drug therapy of depression and anxiety disorders.htm:36: error: Unexpected end tag : tbody
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/15. drug therapy of depression and anxiety disorders.htm:36: error: Unexpected end tag : table
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/16. pharmacotherapy of psychosis and mania.htm:32: error: Unexpected end tag : table
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/16. pharmacotherapy of psychosis and mania.htm:33: error: Unexpected end tag : td
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/16. pharmacotherapy of psychosis and mania.htm:35: error: Unexpected end tag : tr
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/16. pharmacotherapy of psychosis and mania.htm:36: error: Unexpected end tag : tbody
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/16. pharmacotherapy of psychosis and mania.htm:36: error: Unexpected end tag : table
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/16. pharmacotherapy of psychosis and mania.htm:380: error: ID popup already defined
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/16. pharmacotherapy of psychosis and mania.htm:578: error: error parsing attribute name
prince: /home/brentonhorne/Drugs/CHM/Goodman and gillman_html/ii. neuropharmacology/16. pharmacotherapy of psychosis and mania.htm:774: error: ID popup already defined
Without this line the text doesn't fit to the PDF.

Use #page { size: A4 } to set the paper size. If you need bigger paper, try A3, or A4 landscape. Making the paper very big will make it difficult to print out, though.

Related

call of overloaded 'setField(int, double&)' is ambiguous

In this i will face an error: "call of overloaded 'setField(int, double&)' is ambiguous
"
'''
ThingSpeak.setField(1, emon.Irms);
ThingSpeak.setField(2, emon.Vrms);
ThingSpeak.writeFields(ChannelNumber2, apiKey2);
'''

How to create a record in multiple tables in peewee?

my knowledge about database driven app and database ORM is wee, I have written this model in peewee https://codereview.stackexchange.com/q/210293/22943
and I want to be able to update the 3 tables Patient, Relative and PatientAttendOnVisit at the same time with Relative and PatientAttendOnVisit foreign key to Patient ID in Patient table.
I tried straight forward:
def add_patient_visit(data=None):
"""
Adds new visit to clinic of patient
for new or follow up patient.
"""
if not data:
raise ValueError("Please pass the user info.")
try:
patient = _clinic.Patient.get(name=data["name"])
if patient:
print "Patient exists with same name."
response_object = {
"status": "fail",
"message": "Patient already in record."
}
return response_object, 400
except peewee.DoesNotExist as er:
patient = _clinic.Patient.create(
name=data["name"],
townCity=data["townCity"],
contactnumber=data["contactnumber"],
age=data["age"],
gender=data["gender"],
email=data["email"],
postalAddress=data["postalAddress"])
relative = _clinic.Relative.create(relation=data["relation"],
relativeName=data["relativeName"])
attendence = _clinic.PatientAttendOnVisit.create(
dateTimeofvisit=data["dateTimeofvisit"],
attendtype=data["attendtype"],
department=data["department"]
)
but attempting to do so give me below error:
return controller.add_patient_visit(data=data) File
"/Users/ciasto/Development/python/clinic-backend/app/api/clinic/controller.py",
line 35, in add_patient_visit
relativeName=data["relativeName"]) File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/peewee.py",
line 5580, in create
inst.save(force_insert=True) File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/peewee.py",
line 5727, in save
pk_from_cursor = self.insert(**field_dict).execute() File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/peewee.py",
line 1622, in inner
return method(self, database, *args, **kwargs) File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/peewee.py",
line 1693, in execute
return self._execute(database) File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/peewee.py",
line 2355, in _execute
return super(Insert, self)._execute(database) File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/peewee.py",
line 2118, in _execute
cursor = database.execute(self) File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/peewee.py",
line 2724, in execute
return self.execute_sql(sql, params, commit=commit) File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/peewee.py",
line 2718, in execute_sql
self.commit() File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/peewee.py",
line 2509, in exit
reraise(new_type, new_type(*exc_args), traceback) File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/peewee.py",
line 2711, in execute_sql
cursor.execute(sql, params or ()) File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/MySQLdb/cursors.py",
line 205, in execute
self.errorhandler(self, exc, value) File "/Users/ciasto/Development/python/clinic-backend/clinic_venv/lib/python2.7/site-packages/MySQLdb/connections.py",
line 36, in defaulterrorhandler
raise errorclass, errorvalue IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails
(clinic_backend.relative, CONSTRAINT relative_ibfk_1 FOREIGN KEY
(patient_id) REFERENCES patient (id))')
Nothing much complicated, I figured out,
def add_patient_visit(data=None):
"""
Adds new visit to clinic of patient
for new or follow up patient.
"""
if not data:
raise ValueError("Please pass the user info.")
patient = _clinic.Patient.create(
name=data["name"],
townCity=data["townCity"],
contactnumber=data["contactnumber"],
age=data["age"],
gender=data["gender"],
email=data["email"],
postalAddress=data["postalAddress"])
relative = _clinic.Relative.create(
patient=patient,
relation=data["relation"],
relativeName=data["relativeName"])
attendence = _clinic.PatientAttendOnVisit.create(
patient=patient,
dateTimeofvisit=data["dateTimeofvisit"],
attendtype=data["attendtype"],
department=data["department"]
)

Illegal mix of collations for operation 'concat' after replace chinese

Before:
set extrainfo =concat('{"from":"carpool","table":"Block",
"key_field":"b_index","key_value:"',b_index,'","infoid":"',info_id,'",
"code":"0","message":"This trip is valid"}');
run success.
I replaced "This trip is valid" with "行程符合规范" :
set extrainfo =concat( '{"from":"carpool","table":"Block","key_field":
"b_index","key_value:"',b_index,'","infoid":"',info_id,'",
"code":"0","message":"行程符合规范"}');
show me:
(node:30849) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1):
`enter code here`Error: ER_CANT_AGGREGATE_NCOLLATIONS:
`enter code here`Illegal mix of collations for operation 'concat'
Can you help me?
I changed Codes:
set extrainfo =concat( '{"from":"carpool","table":"Block","key_field":
"b_index","key_value:"',convert(b_index,char),'","infoid":"',convert(info_id,char),'",
"code":"0","message":"行程符合规范"}');
replace b_index with convert(b_index,char). It works well.

BreezeJs and Chrome 33

BreezeJS throws the following error on Chrome:
[Q] Unhandled rejection reasons (should be empty):
["Error: Illegal construction - use 'or' to combine …tp://localhost:6592/Scripts/breeze.min.js:5:9573)"]
0: "Error: Illegal construction - use 'or' to combine checks↵ at m (localhost:6592/Scripts/breeze.min.js:1:11658)↵ at r.isOptional (localhost:6592/Scripts/breeze.min.js:1:13100)↵ at k.getKey (localhost:6592/Scripts/breeze.min.js:2:5019)↵ at M [as _$interceptor] (localhost:6592/Scripts/breeze.min.js:1:7492)↵ at a.splice.h.computed.write (localhost:6592/Scripts/breeze.min.js:5:30754)↵ at dependentObservable [as id] (localhost:6592/Scripts/knockout-2.3.0.debug.js:1298:31)↵ at a.setProperty (localhost:6592/Scripts/breeze.min.js:5:31148)↵ at localhost:6592/Scripts/breeze.min.js:3:11420↵ at Array.forEach (native)↵ at q._updateTargetFromRaw (localhost:6592/Scripts/breeze.min.js:3:11058)↵ at k (localhost:6592/Scripts/breeze.min.js:5:9573)"
1: "Error: Illegal construction - use 'or' to combine checks↵ at m (localhost:6592/Scripts/breeze.min.js:1:11658)↵ at r.isOptional (localhost:6592/Scripts/breeze.min.js:1:13100)↵ at k.getKey (localhost:6592/Scripts/breeze.min.js:2:5019)↵ at M [as _$interceptor] (localhost:6592/Scripts/breeze.min.js:1:7492)↵ at a.splice.h.computed.write (localhost:6592/Scripts/breeze.min.js:5:30754)↵ at dependentObservable [as id] (localhost:6592/Scripts/knockout-2.3.0.debug.js:1298:31)↵ at a.setProperty (localhost:6592/Scripts/breeze.min.js:5:31148)↵ at localhost:6592/Scripts/breeze.min.js:3:11420↵ at Array.forEach (native)↵ at q._updateTargetFromRaw (localhost:6592/Scripts/breeze.min.js:3:11058)↵ at k (localhost:6592/Scripts/breeze.min.js:5:9573)"
length: 2
proto: Array[0]
Updated 3/1/2014
Ok, we think that this is fixed in Breeze v 1.4.9 ( or later) available now.
Previous post
This is a problem that we have been tracking. It appears to occur only on the minified version of Breeze in Chrome 33. We are planning a fix for later this week. Until then try using the unminified version.

HTML: border not visible in <td> tag in firefox

I have a simple table in HTML> I want each cell in the the table to have its own border. I defined a CSS property for it like:
td {
width: 350px;
height: 50px;
border:thick;
border-color: black;
border-radius: 5px;
}
Html:
< table border="0">
<tr><td>Row1</td></tr>
<tr><td>Row2</td></tr>
<tr><td>Row3</td></tr>
</table>
The border is visible in the "Dreamweaver Design Mode" but when the document runs in firefox, the border vanishes. Why is it happening?
Try this:-
Demo
See Ref
<table>
<tr><td>Row1</td></tr>
<tr><td>Row2</td></tr>
<tr><td>Row3</td></tr>
</table>
td{
width: 350px;
height: 50px;
border: thick solid black;
border-radius: 5px;
}
In situations like this, where you get deviation between browsers, I always recommend going directly to a validator!
http://validator.nu/
Gives me these errors when I put your code in (with the css in a style tag in the head):
Error: Bad character after <. Probable cause: Unescaped <. Try escaping it as <. At line 15, column 2 tyle>↩</head>↩< table border=" Error: Stray start tag tr. From line 16, column 5; to line 16, column 8
="0">↩ <tr><td>Ro Error: Stray start tag td. From line 16, column 9; to line 16, column 12
>↩ <tr><td>Row1</ Error: Stray end tag td. From line 16, column 17; to line 16, column 21 r><td>Row1</td></tr> Error: Stray end tag tr. From line 16, column 22; to line 16, column 26
>Row1</td></tr> ↩ Error: Stray start tag tr. From line 17, column 5; to line 17, column 8 /tr> ↩ <tr><td>Ro Error: Stray start tag td. From line 17, column 9; to line 17, column 12 ↩ <tr><td>Row2</ Error: Stray end tag td. From line 17, column 17; to line 17, column 21 r><td>Row2</td></tr> Error: Stray end tag tr. From line 17, column 22; to line 17, column 26
>Row2</td></tr> ↩ Error: Stray start tag tr. From line 18, column 5; to line 18, column 8 r> ↩ <tr><td>Ro Error: Stray start tag td. From line 18, column 9; to line 18, column 12 ↩ <tr><td>Row3</ Error: Stray end tag td. From line 18, column 17; to line 18, column 21 r><td>Row3</td></tr>↩ Error: Stray end tag tr. From line 18, column 22; to line 18, column 26
>Row3</td></tr>↩</tab Error: Stray end tag table. From line 19, column 1; to line 19, column 8 /td></tr>↩</table>
The most important being the firstish entry:
Error: Bad character after <. Probable cause: Unescaped <. Try escaping it as <. At line 15, column 2 tyle>↩</head>↩< table border=" Error: Stray start tag tr. From line 16, column 5; to line 16, column 8