summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Erikson <ulferikson@gmail.com>2006-08-05 21:06:29 +0000
committerulferikson <ulferikson@users.sourceforge.net>2006-08-05 21:06:29 +0000
commit379e8a4204da51c1d11875951a8ecd5cf984f31f (patch)
treea1223901416563f678cb8c64637a8d932f69af21 /src
parentFlush to file more often to avoid huge StringStreams. (diff)
downloadinkscape-379e8a4204da51c1d11875951a8ecd5cf984f31f.tar.gz
inkscape-379e8a4204da51c1d11875951a8ecd5cf984f31f.zip
Bug 1527659 (Lack of canvas dimensions integrity from SVG to PDF)
MediaBox doesn't have to be limited to whole points. (bzr r1562)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/pdf-mini.h6
-rw-r--r--src/extension/internal/pdf.cpp7
2 files changed, 6 insertions, 7 deletions
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;