Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 1af359f

Browse files
runrevmarkpeter-b
authored andcommitted
[[ Bug 17541 ]] Update revpdfprinter to use latest cairo (#4535)
This patch updates revpdfprinter to use the latest cairo update. This appears to fix problems with printing generated PDFs on some printers.
1 parent 0cc0d10 commit 1af359f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

docs/notes/bugfix-17541.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Fix problems with printing PDFs to some printers
2+
3+
It was possible for LiveCode to generate PDFs which were incompatible
4+
with some printers. This has been fixed by upgrading the PDF generation
5+
library which LiveCode uses (cairo).

revpdfprinter/src/revpdfprinter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ bool MCPDFPrintingDevice::BeginDocument(const MCCustomPrinterDocument& p_documen
256256

257257
if (t_success)
258258
{
259-
cairo_pdf_object_t t_value;
260-
t_value.type = CAIRO_PDF_OBJECT_TYPE_STRING;
259+
cairo_pdf_value_t t_value;
260+
t_value.type = CAIRO_PDF_VALUE_TYPE_STRING;
261261
if (p_document.option_count > 0)
262262
{
263263
t_success = MCMemoryNewArray(p_document.option_count, m_option_keys);
@@ -293,8 +293,8 @@ bool MCPDFPrintingDevice::BeginDocument(const MCCustomPrinterDocument& p_documen
293293

294294
if (t_success)
295295
{
296-
cairo_pdf_object_t t_date_object;
297-
t_date_object.type = CAIRO_PDF_OBJECT_TYPE_DATE;
296+
cairo_pdf_value_t t_date_object;
297+
t_date_object.type = CAIRO_PDF_VALUE_TYPE_DATE;
298298
t_success = set_cairo_pdf_datetime_to_now(t_date_object.date);
299299
if (t_success)
300300
cairo_pdf_surface_set_metadata(m_surface, "CreationDate", &t_date_object);

0 commit comments

Comments
 (0)