From: ulferikson Date: Sat, 5 Aug 2006 21:06:29 +0000 (+0000) Subject: Bug 1527659 (Lack of canvas dimensions integrity from SVG to PDF) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b6acc092247d6dbe11b505795803c730c9dd5090;p=inkscape.git Bug 1527659 (Lack of canvas dimensions integrity from SVG to PDF) MediaBox doesn't have to be limited to whole points. --- diff --git a/src/extension/internal/pdf-mini.h b/src/extension/internal/pdf-mini.h index d0b4ea1f1..32f8e284c 100644 --- a/src/extension/internal/pdf-mini.h +++ b/src/extension/internal/pdf-mini.h @@ -41,8 +41,8 @@ class PdfFile { PdfObject *begin_document(double version = 1.2); void end_document(PdfObject *doc_info); - PdfObject *begin_page(int x0, int y0, int x1, int y1); - PdfObject *begin_page(int w, int h) { return begin_page(0,0, w, h); } + PdfObject *begin_page(double x0, double y0, double x1, double y1); + PdfObject *begin_page(double w, double h) { return begin_page(0,0, w, h); } void end_page(PdfObject *page); PdfObject *begin_object(); void end_object(PdfObject *object); @@ -238,7 +238,7 @@ void PdfFile::end_document(PdfObject *doc_info) { delete obj_info; } -PdfObject *PdfFile::begin_page(int x0, int y0, int x1, int y1) { +PdfObject *PdfFile::begin_page(double x0, double y0, double x1, double y1) { Inkscape::SVGOStringStream os; resources = new PdfXref[11](); diff --git a/src/extension/internal/pdf.cpp b/src/extension/internal/pdf.cpp index 2e8d8813b..50e98d00c 100644 --- a/src/extension/internal/pdf.cpp +++ b/src/extension/internal/pdf.cpp @@ -361,8 +361,8 @@ PrintPDF::begin(Inkscape::Extension::Print *mod, SPDocument *doc) // printf("Page Bounding Box: %s\n", pageBoundingBox ? "TRUE" : "FALSE"); if (pageBoundingBox) { d.x0 = d.y0 = 0; - d.x1 = ceil(_width); - d.y1 = ceil(_height); + d.x1 = _width; + d.y1 = _height; } else { SPItem* doc_item = SP_ITEM(sp_document_root(doc)); sp_item_invoke_bbox(doc_item, &d, sp_item_i2r_affine(doc_item), TRUE); @@ -373,8 +373,7 @@ PrintPDF::begin(Inkscape::Extension::Print *mod, SPDocument *doc) d.y1 *= PT_PER_PX; } - page_stream = pdf_file->begin_page( (int) d.x0, (int) d.y0, - (int) d.x1, (int) d.y1 ); + page_stream = pdf_file->begin_page( d.x0, d.y0, d.x1, d.y1 ); if (!_bitmap) { Inkscape::SVGOStringStream os;