Text boxes appear upside-down after PDF import

Bug #169126 reported by Ozmikepittman
10
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Miklosh

Bug Description

Platform: Windows XP SP2
Version: Various Inkscape 0.46 Dev builds - latest is Nov 1, 2007. 0.45
builds don't have PDF import.

Here's the repeatable steps to make this happen;

1. Start a fresh Inkscape session
2. Open an existing PDF using the normal open dialogue (not import)
3. Open a page using any combination of clipping, embed images and
precision settings.
4. Click on text tool and drag on page to make a text box.
5. Release mouse button and text box flips upside-down.
6. Type some text (appears upside-down).
7. Click on select tool and select text box, select flip vertically.
8. Work normally.

Notes:
a. This does not seem to happen if you use the File -> import menu option
instead.

b. If you put the flipped text on a path and then move the path vertically,
the text moves in the opposite direction. This gets really messy, so I just
took to dragging the text, not the path.

Revision history for this message
Ozmikepittman (ozmikepittman) wrote :
Revision history for this message
Ozmikepittman (ozmikepittman) wrote :

Originator: YES

I've also attached the resulting svg file before using the flip tool.

Additional Notes:
c. Don't know if this happens if there is no text in the PDF.

d. This seemed to happen with PDF files from OpenOffice and also from
PDFCreator (www.pdfforge.org) that uses Ghostscript. Doesn't seem to be the
PDF file's fault.
File Added: test.svg

Revision history for this message
Ozmikepittman (ozmikepittman) wrote :

Originator: YES

Just to clarify - when I say "latest is Nov 1, 2007" that doesn't mean
that I've noticed the bug disappear. It means that's the latest version
I've tested this in. I'm over my download quota for the month, so I'm
reluctant to download a more recent version.

Revision history for this message
vonHalenbach (lustik) wrote :

SVG and PDF use different coordinate systems. maybe that is the source of the bug.

Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Rygle (rygle) wrote :

Hi - I am the bug originator, but my user name has changed with the new system.

I have again checked this in the latest development release (Dec 16 2007) and the same pdf file supplied (although it does it with any in my experience), and the bug still exists.

vonHalenbach wrote:
    " SVG and PDF use different coordinate systems. maybe that is the source of the bug."

If the origin of the problem is SVG vs. PDF, then I am puzzled as to why it does not occur when File -> Import is used. The bug only occurs on File -> Open. IMHO I think the "Open" routine should just be changed to be exactly the same as the "import" routine in this case. Something is different between the two that is causing this.

Revision history for this message
Rygle (rygle) wrote :

I think I may have found the place this bug manifests in the raw XML of an SVG file. It is in a transform statement in the header of the SVG file that affects the whole document.

Here are the steps to fix a document with a single image. I have not tried one with multiple images on the one page.

1. Start a new document, and then open (not import) a PDF file, then save as an SVG.
2. Open the SVG file in a text editor, replace "transform="matrix(1.25,0,0,-1.25,0,990)"" (strip outer set of quotes) with "transform="matrix(1.25,0,0,1.25,0,0)"" and save.
3. Re-open SVG file in Inkscape, select and flip image back to normal orientation
4. Click on text tool, drag to create text box. It will now retain its original orientation.

There are also transform statements for each block of text that can be similarly changed by deleting the minus from the fourth element in the transform matrix, but I think this again mucks up any subsequently inserted text elements.

I don't think this is a realistic process for people to go through to correct documents, but I did this in case it helps the techos working on this. In real life it is much easier to open the PDF document, then select the individual images and copy and paste them into a different document. This other document won't have the transform=matrix problems

Revision history for this message
Rygle (rygle) wrote :

Could this be related to the Cairo bug reported upstream here?

http://lists.cairographics.org/archives/cairo/2008-January/012800.html

This is also related to the transform="matrix..." statement. I don't know, but if this is remotely on the track and helps someone a bit more tech savvy then good.

Revision history for this message
Rygle (rygle) wrote :

This seems to be fine on the 0.46pre4 release. Closing

Changed in inkscape:
status: Confirmed → Fix Committed
Revision history for this message
naught101 (naught101) wrote :

This is not fixed in 0.46 in Ubunutu Hardy.

Changed in inkscape:
status: Fix Committed → Confirmed
Revision history for this message
Rygle (rygle) wrote :

If this is cross platform and fixed on Win32 0.46 but not non-win32, then it strongly suggests to me that it's dependency related, ie: probably Cairo. Win32 is currently using a build of Cairo 1.5.15 (1.6 release candidate), while I believe Linux is using cairo 1.4.x

If possible, can someone try upping the version of Cairo to 1.5.x on linux, and let us know what happens. Rygle.

Revision history for this message
Rygle (rygle) wrote :

Does this still happen on Inkscape 0.46 on ubuntu hardy? Can anyone confirm a problem?

I am assuming that this is probably fixed, given that the cairo 1.6 library is now standard in Hardy, and that seemed to fix things for Win32.

Will re-mark as fixed if I don't hear anything soon.

Revision history for this message
Adrian Johnson (ajohnson-redneon) wrote :

I don't think this has anything to do with cairo. The bug is about importing a PDF file which uses the poppler library.

The fact that the bug does not occur on win32 does not necessarily point to a dependency issue. For example, the following (fixed) bug was for upside down text on cairo PDF export on win32 only. It turned out to be a bug in Inkscape that only occurred on win32 due to different code paths used for export on win32 and Linux.

https://bugs.launchpad.net/inkscape/+bug/189432

Revision history for this message
Rygle (rygle) wrote :

Thanks Adrian. Point taken. Wasn't thinking, but picked up on my comment from a month ago. Just trying to help, and good that you are too.

Still want to make sure this is really sorted out and closed off for 0.46.1, but it's bad to hear that naught101 is still experiencing it.

Revision history for this message
Guillermo Espertino (Gez) (gespertino-gmail) wrote :

This bugs seems to affect more than simply text boxes. imported images and clipboard operations seem to be affected too.
Could you please confirm this?
In my particular case I have the same problems plus wrong behavior of paste in place (object is upside-down and larger) and imported images are upside-down too.

Revision history for this message
naught101 (naught101) wrote :

Sorry for the poor form on that previous comment.

everything imports into inkscape upside-down AND transformed the right way up. So everything looks fine, until you remove the transforms, or you write new text, in a box. interestingly, if the new text is not in a box, a transform is applied so that it looks right.

I'm using Hardy, with the standard Inkscape 0.46, built Apr 7 2008. I'll upgrade and see what happens.

Revision history for this message
naught101 (naught101) wrote :

wait... Rygle... 0.46.1 doesn't exist yet...

and Rygle, you can claim your old username on launch pad. Click the name, then click "overview", then "Are you <username>?" down the bottom.

Revision history for this message
bbyak (buliabyak) wrote :

rev 20111 on linux imports test.pdf without any flipping... although the outlines of the face are missing.

can we close this?

Revision history for this message
FrankL (ftmleone) wrote :

I got the same problem in Ubuntu (8.04/8.10) with Inkscape 0.46, but then when opening .ai files. It does work when I copy a textbox from a separate file, but not when I directly make one in the .ai file, even it is already saved as an svg.

So, probably it can't be closed yet.

Revision history for this message
bbyak (buliabyak) wrote :

FrankL: this tracker is for the development version bugs - if something is broken in 0.46 but fixed in latest devel build we close it here.

Changed in inkscape:
status: Confirmed → Fix Released
su_v (suv-lp)
tags: added: importing
removed: fonts import linux win32
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.