I am a new user to Aspose PDF so this is a very basic question:
I would like to render a single EMF file across an entire page (i.e. stretch the EMF across the full page length-wise and height-wise). The EMF file contains vector graphics, but when I place it in the PDF, it looks very ugly, as if it was bitmapped and not vector-rendered.
The EMF file I’m using is attached (emf.zip). Also attached is a jpg of what it outputs as (screenshot taken in Acrobat). It’s ugly and bitmapped-looking. It prints like this too.
Here is the code I’m using:
////////////////
Pdf pdf = new Pdf();
pdf.IsLandscape = true;
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(“D:\Aspose.Total.lic”);
Section sec1 = pdf.Sections.Add();
Aspose.Pdf.Image image = new Aspose.Pdf.Image(sec1);
image.ImageInfo.File = “C:\0.emf”;
image.ImageInfo.ImageFileType = ImageFileType.Emf;
sec1.Paragraphs.Add(image);
pdf.Save(“C:\Test.pdf”);
////////////
Could you please tell me what I need to do to get the EMF rendered properly as vector graphics?
(Also, I’m not sure how to make the emf cover the whole page. Adding the image as shown in the code above by default places it in an odd location, which seems strange to me.)
Thank you.
To add to this, I know the attached EMF file is valid because (1) it previews in image viewers properly, and (2) I am able print that EMF in other applications we have (including another PDF methodology) and it prints perfectly.
Hello Duy,
Thanks for considering Aspose.
I'm sorry to inform you that vectors images are not yet supported by Aspose.Pdf. In order to display them over PDF document, first they are converted into Bitmap format and then placed over PDF file.
Whereas concerning to set the image height and width, please try using FixWidth & FixHeight Properties of ImageInfo Class.
In order to place an image at any particular location of the page, you can also try using Floating Box which can easily be positioned by the customer at any location of the PDF document.
We apologize for your inconvenience.
Beside this, as far as I can see, your EMF file contains very simple information and such output can easily be generated using Aspose.Pdf. You can simply add a table and put respective values in rows and columns of the table. Placing a Header and Footer section in PDF file is also very easy.
You may take a look over following links for information on
In case of any further query, please feel free to contact.
Hello,
Thanks for considering aspose product.
I am afraid it is a known issue that vector image is not supported at present. As a workaround, EMF is converted into bitmap in Aspose.Pdf. I don't think we can support vector image in short time. Sorry for your inconvenience.
Best regards.