← All bug reports

FS#2791PDF import: vertical text imported rotated by 180°

Type
Bug
Status
Closed
Resolution
Fixed
Category
QCAD (main)
Severity
Low
Priority
Low
Reported version
27.0.6
Operating system
All
Reported
2026-11-26 by andrew

Problem

When importing some PDF files (e.g. plans exported from Archicad / PDFTron), text that runs vertically (rotated 90°) is imported upside down, i.e. rotated by 180° and displaced from its original position. Horizontal and other rotated texts are not affected.

The importer flagged a text as "backward" and "upside-down" whenever the two diagonal entries of its transformation matrix (m11, m22) were both negative. For vertical text, these entries are effectively zero and their sign is arbitrary. In the affected files they are tiny negative values, so the text was flipped in addition to its correct 90° rotation. The text x-scale was computed from the same two entries and was therefore also unreliable for rotated text.

Solution

The text transformation matrix is now decomposed properly in RPdfImporter::importText (qcadpro/src/io/pdf/RPdfImporter.cpp):

  • The text angle is taken from the direction of the transformed x axis (unchanged).
  • Text is only treated as mirrored (upside-down) if the determinant of the matrix is negative.
  • The x-scale is the ratio of the lengths of the transformed x and y axes.