summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0f1b8f5)
raw | patch | inline | side by side (parent: 0f1b8f5)
author | miklosh <miklosh@users.sourceforge.net> | |
Mon, 23 Jul 2007 14:05:39 +0000 (14:05 +0000) | ||
committer | miklosh <miklosh@users.sourceforge.net> | |
Mon, 23 Jul 2007 14:05:39 +0000 (14:05 +0000) |
src/extension/internal/pdfinput/pdf-input.cpp | patch | blob | history | |
src/extension/internal/pdfinput/pdf-parser.cpp | patch | blob | history |
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index db401731f1d975322ec36aced5ca2a0250144bbb..2fe6c73d31122b76fe6e8624ee0956026e0129a6 100644 (file)
Object obj;
page->getContents(&obj);
if (!obj.isNull()) {
- pdf_parser->saveState();
pdf_parser->parse(&obj);
- pdf_parser->restoreState();
}
// Cleanup
diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
index c64f5de06fe3b4fbfda037c531dd2d0b773b0957..c76b4927b73058bc2ae1d07e85a14565a73c107b 100644 (file)
@@ -310,6 +310,7 @@ PdfParser::PdfParser(XRef *xrefA, Inkscape::Extension::Internal::SvgBuilder *bui
baseMatrix[i] = ctm[i];
scaledCTM[i] = PX_PER_PT * ctm[i];
}
+ saveState();
builder->setTransform((double*)&scaledCTM);
formDepth = 0;
double a5 = args[5].getNum();
if (!strcmp(prevOp, "q")) {
builder->setTransform(a0, a1, a2, a3, a4, a5);
- } else if (!strcmp(prevOp, "cm")) {
+ } else if (!strcmp(prevOp, "cm") || !strcmp(prevOp, "startPage")) {
// multiply it with the previous transform
double otherMatrix[6];
if (!builder->getTransform((double*)&otherMatrix)) { // invalid transform
otherMatrix[0] = otherMatrix[3] = 1.0;
otherMatrix[1] = otherMatrix[2] = otherMatrix[4] = otherMatrix[5] = 0.0;
}
- double c0 = otherMatrix[0]*a0 + otherMatrix[1]*a2;
- double c1 = otherMatrix[0]*a1 + otherMatrix[1]*a3;
- double c2 = otherMatrix[2]*a0 + otherMatrix[3]*a2;
- double c3 = otherMatrix[2]*a1 + otherMatrix[3]*a3;
- double c4 = otherMatrix[4]*a0 + otherMatrix[5]*a2 + a4;
- double c5 = otherMatrix[4]*a1 + otherMatrix[5]*a3 + a5;
+ double c0 = a0*otherMatrix[0] + a1*otherMatrix[2];
+ double c1 = a0*otherMatrix[1] + a1*otherMatrix[3];
+ double c2 = a2*otherMatrix[0] + a3*otherMatrix[2];
+ double c3 = a2*otherMatrix[1] + a3*otherMatrix[3];
+ double c4 = a4*otherMatrix[0] + a5*otherMatrix[2] + otherMatrix[4];
+ double c5 = a4*otherMatrix[1] + a5*otherMatrix[3] + otherMatrix[5];
builder->setTransform(c0, c1, c2, c3, c4, c5);
} else {
builder->pushGroup();