No, Impict images are bit-maps, essentially. They just store additional meta information about the (text) objects, so that the objects can be edited and modified. But even the text is - once rendered - a bitmap.Basically it's about the Impict-to-PDF pipeline. An IPP file stores text and shape objects as vectors but they are rendered at low (screen) resolution.
Help with Images in Output PDF
Moderators: Alexander Halser, Tim Green
- Alexander Halser
- EC-Software Support
- Posts: 4106
- Joined: Mon Jun 24, 2002 7:24 pm
- Location: Salzburg, Austria
- Contact:
Re: Help with Images in Output PDF
Alexander Halser
Senior Software Architect, EC Software GmbH
Senior Software Architect, EC Software GmbH
- Martin Wynne
- Posts: 2656
- Joined: Mon May 12, 2003 3:21 pm
- Location: West of the Severn, UK
Re: Help with Images in Output PDF
Hi Alexander,Alexander Halser wrote:When you use a WMF, EMF
But unfortunately Impict won't export metafiles. I have often wanted that, should I add it to the wish list?
I'm a great fan of EMF metafiles and use them a lot. They seem to have fallen out of favour being an ancient Microsoft format, but they still work great for CAD-style applications and much easier to code to/from a device context than SVG, PDF, XPS vector formats.
regards,
Martin.
- Alexander Halser
- EC-Software Support
- Posts: 4106
- Joined: Mon Jun 24, 2002 7:24 pm
- Location: Salzburg, Austria
- Contact:
Re: Help with Images in Output PDF
No, it does not export metafiles. It cannot, it's not designed for that at all. Making Impict a vector-based drawing program would be nice, but requires a complete rewrite from scratch including a new image format. We can as well use any SVG editor instead.
What makes vector graphics so complicated in this regard is the transparency option. Once alpha transparency is part of the game - in particular alpha transparency that changes within the object boundaries like opaque at top and transparent at bottom - it becomes extremely difficult to maintain that. H&M does not support this for SVG images, either. Because every link in the drawing chain, from on-screen display to the PDF engine to the PDF viewer, must support it.
When H&M exports an SVG image to PDF, it analyzes it first. If the SVG contains drawing commands that cannot be translated into matching PDF drawing commands, it forces a fork, paints the SVG to a PNG images and exports the PNG instead. If you notice in the PDF, that texts in the image can no longer be selected with the mouse, it's a converted PNG.
In Webhelp, H&M exports the SVG image as it is and leaves it to the web browser to deal with it. If the browser doesn't support it, no longer our problem, so to speak. In CHM files it's almost guaranteed that the MSIE does not support SVG, so we generally convert to PNG for this format. Same for Word documents and ePUB.
What makes vector graphics so complicated in this regard is the transparency option. Once alpha transparency is part of the game - in particular alpha transparency that changes within the object boundaries like opaque at top and transparent at bottom - it becomes extremely difficult to maintain that. H&M does not support this for SVG images, either. Because every link in the drawing chain, from on-screen display to the PDF engine to the PDF viewer, must support it.
When H&M exports an SVG image to PDF, it analyzes it first. If the SVG contains drawing commands that cannot be translated into matching PDF drawing commands, it forces a fork, paints the SVG to a PNG images and exports the PNG instead. If you notice in the PDF, that texts in the image can no longer be selected with the mouse, it's a converted PNG.
In Webhelp, H&M exports the SVG image as it is and leaves it to the web browser to deal with it. If the browser doesn't support it, no longer our problem, so to speak. In CHM files it's almost guaranteed that the MSIE does not support SVG, so we generally convert to PNG for this format. Same for Word documents and ePUB.
Alexander Halser
Senior Software Architect, EC Software GmbH
Senior Software Architect, EC Software GmbH
-
- Posts: 454
- Joined: Thu Nov 16, 2006 1:29 pm
- Location: London, UK
Re: Help with Images in Output PDF
I think you'll find that the IPP file structure contains all the data you'd need to create an SVG — you could equally well have said "Impict images are vectors, essentially. They just store additional bitmaps...". Here's an example: As far as I can see this translates as:Alexander Halser wrote:No, Impict images are bit-maps, essentially. They just store additional meta information about the (text) objects, so that the objects can be edited and modified. But even the text is - once rendered - a bitmap.Basically it's about the Impict-to-PDF pipeline. An IPP file stores text and shape objects as vectors but they are rendered at low (screen) resolution.
- 04 Left 02 35 = 4 character property "Left" then one byte value hex 35 is decimal 53
- 03 Top 03 82 00 = 3 character property "Top" then one word value hex 0082 is decimal 130
- 0B DisplayName 06 05 Text1 = 11 character property "DisplayName" then string of 5 characters value "Text1"
- Then the rendered Text1 is stored as a bitmap
- Hex 18 is decimal 24 character string "Text was added in Impict"
- ...and so on for the alignment, font-name, colour etc.
Code: Select all
<image
xlink:href="capture.png"
width="360"
height="152"
preserveAspectRatio="none"
/>
<text
id="Text1"
transform="matrix(1 0 0 1 53 130)"
style="fill:#008000; font-family:'TimesNewRomanPSMT'; font-size:11px;">
Text was added in Impict
</text>
You do not have the required permissions to view the files attached to this post.
Last edited by Simon Dismore on Thu Feb 09, 2017 12:09 pm, edited 3 times in total.
- Martin Wynne
- Posts: 2656
- Joined: Mon May 12, 2003 3:21 pm
- Location: West of the Severn, UK
Re: Help with Images in Output PDF
Hi Alexander,Alexander Halser wrote:No, it does not export metafiles. It cannot
Thanks for the detailed reply.
Clearly you know your own program, but I'm a bit surprised by this.
To export a metafile rather than a bitmap, I simply use the same drawing routine and pass a TMetafileCanvas instead of a TCanvas.
StretchDrawn bitmaps go into the metafile as bitmap objects, but items drawn on the canvas using Pens and Brushes (i.e. text, lines, filled polygons, etc.) remain as drawing commands in the metafile and display as crisp vector items when zoomed.
For me, one big advantage of this ancient Microsoft technology is that it works fine in Wine on Linux systems, including in CrossOver on a Mac, which suits many of my users.
regards,
Martin.