Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when printing in vecteur mode with background raster #1163

Closed
eolmapper opened this issue Oct 25, 2018 · 15 comments · Fixed by #1182

Comments

@eolmapper
Copy link

commented Oct 25, 2018

Steps to reproduce

  1. Open a raster template without géoréférencing. (aérial photo .jpg)
  2. Move the angle
  3. Draws some vectors on it (contours)
  4. Print it in vertor mode with "show template" activated

Actual behaviour

The preview is good, but the template does not appear in the final printed map.

I have an other issue with the same map imported from Ocad 2018:
The preview is good.
In the final printed map, the template appear corectly, but the vectors are very smal in the top left corner

Expected behaviour

If i make an PDF export, all is good.

Configuration

Mapper Version: 0.8.3
Operating System: Windows seven

edit:
screenshots with printing/export dialog settings widget:
image
Résult with a virtual or réal printer:
image
zoom top left corner:
image

@Symbian9

This comment has been minimized.

Copy link
Contributor

commented Oct 31, 2018

Please, add also screenshots with printing/export dialog settings widget.

@eolmapper

This comment has been minimized.

Copy link
Author

commented Nov 5, 2018

add done

@dg0yt

This comment has been minimized.

Copy link
Member

commented Nov 12, 2018

@Symbian9, what did you find out with the screenshots?

@Symbian9

This comment has been minimized.

Copy link
Contributor

commented Nov 12, 2018

what did you find out with the screenshots?

I see that "Resolution:" set to 1200 dpi (by default, Mapper use 600 dpi)

Also, I see that map has unusual scale: 1:3000.

Maybe, those factors in some way generate issue with printer properties (e.g., settings of HP67B610 (HP OfficeJet Pro 6230) or settings of virtual printer).

@eolmapper, could you also add screenshot with printer properties dialog?

pic.1

Also, add screenshot with your template (background image) positioning properties:

pic.2

P.S.: @dg0yt, I think that Mapper ignore *"X-Scale:" & "Y-Scale:" template positioning properties (or set it to 1.0) before send map file for printing to real or virtual "Printer". Of course, I could be wrong.

@dg0yt

This comment has been minimized.

Copy link
Member

commented Nov 12, 2018

1200 dpi is fine. 1:3000 also. There is nothing unusual about it.

@Symbian9

This comment was marked as off-topic.

Copy link
Contributor

commented Nov 12, 2018

Steps to reproduce

  1. Open a raster template without géoréférencing. (aérial photo .jpg)
  2. Move the angle
  3. Draws some vectors on it (contours)
  4. Print it in vertor mode with "show template" activated

@eolmapper, can you explain, what method you use for hide unused parts (red areas) on this background image (aérial photo .jpg)

pic.1

@eolmapper

This comment has been minimized.

Copy link
Author

commented Nov 13, 2018

Dont focus to my screenshots exemple.

With new file, scale 10000, 600dpi, random jpg:
image
When i put an angle (0.01 for exemple) to the template in the positionning windows:
image

@Symbian9

This comment has been minimized.

Copy link
Contributor

commented Nov 13, 2018

Dont focus to my screenshots exemple.

When i put an angle (0.01 for exemple) to the template in the positionning windows:

I just tried reproduce all steps, print it as "Print - Save as PDF" and "Print - Boomaga (virtual printer)" , but can't reproduce this issue under Linux (Debian 9.x, x86_64).

Maybe, this issue related to printing under Windows/Windows 7?

P.S.: Only virtual printer I found for Linux is Boomaga:

@dg0yt

This comment has been minimized.

Copy link
Member

commented Nov 14, 2018

Yesterday I was able to reproduce this issue on Windows. As I expected, this is specific to Windows. (Printing is platform-dependant, unlike PDF export. For Windows, I needed to implement extra workarounds. On Linux, I use printing regularly.)

@Symbian9 Most Linux distributions offer a virtual PDF printer. In Ubuntu 16.04, it is the printer-driver-cups-pdf package.

@dg0yt dg0yt self-assigned this Nov 14, 2018
@Symbian9

This comment has been minimized.

Copy link
Contributor

commented Nov 14, 2018

Most Linux distributions offer a virtual PDF printer. In Ubuntu 16.04, it is the printer-driver-cups-pdf package.

Yes, I know ;-)

I tried Boomaga just in hope to reproduce this issue using 3rd-party non-standard virtual printer on Linux, because CUPS never give me such buggy output as described in this issue.

added the known issues v0.8.3 label

Label Windows should be added to.

@Symbian9

This comment was marked as off-topic.

Copy link
Contributor

commented Nov 14, 2018

FTR, @dg0yt, when on Linux set in "Print ..." dialog "Save to PDF": it export to PDF using internal "Export... - PDF" or export to PDF using CUPS?

pic.1

If this is CUPS, then we should be clear and show it as:

pic.2

Think, if there are NO any virtual (such as CUPS, Boomaga, etc.) or real printers detected then Mapper should show only such info dialog:

pic.3

dg0yt added a commit that referenced this issue Nov 19, 2018
Improve locality:
Use local painters on the stack instead of new/delete.
Keep QPainter save/configure/restore close together for each stage
(background, map, foreground).

Fix buffer handling:
Never draw the external page buffer to the external device painter:
This buffer is this painter's device.
Never reuse the page buffer for the map buffer.
Catch all buffer allocation errors.

Improve transformation handling:
Combine the page extent transformation with the (device) painter's
original transformation. This is important for Windows where we use
a very high resolution in the GDI interface, different from the
resolution configured for the printer. Together with 22f4bdb, this
change fixes #1163.
@dg0yt dg0yt referenced this issue Nov 19, 2018
@dg0yt

This comment has been minimized.

Copy link
Member

commented Nov 20, 2018

Attaching test files.

#1163 vector printing.zip

@Symbian9

This comment was marked as off-topic.

Copy link
Contributor

commented Nov 20, 2018

Attaching test files.

#1163 vector printing.zip

Due to not yet solved issue #1178, this test case may not work on unstable build under Windows

pic.1

dg0yt added a commit that referenced this issue Dec 1, 2018
Improve locality:
Use local painters on the stack instead of new/delete.
Keep QPainter save/configure/restore close together for each stage
(background, map, foreground).

Fix buffer handling:
Never draw the external page buffer to the external device painter:
This buffer is this painter's device.
Never reuse the page buffer for the map buffer.
Catch all buffer allocation errors.

Improve transformation handling:
Combine the page extent transformation with the (device) painter's
original transformation. This is important for Windows where we use
a very high resolution in the GDI interface, different from the
resolution configured for the printer. Together with 22f4bdb, this
change fixes #1163.
@dg0yt dg0yt closed this in #1182 Dec 12, 2018
@dg0yt

This comment has been minimized.

Copy link
Member

commented Dec 13, 2018

Please verify that the latest master build fixes the issue for you. Thanks!

@eolmapper

This comment has been minimized.

Copy link
Author

commented Dec 15, 2018

it's working well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.