Vector graphic wmf to pdf

I am trying to turn multiple vector graphic wmf files into a single, multi page vector graphic pdf. Does anyone know how this can be done? We have Aspose.PDF but this does not seem to handle SVG files.

Hi Tony,

Thanks for your interest in our products.

Kindly check the following documentation links for details and code snippets as per your requirement.

Please feel free to contact support in case you need any further assistance.

Thanks & Regards,

Hi Tony,

Adding more to Rashid’s comments, you may also consider visiting the following link for information on Use Image from Local Disk

Thanks Rashid,


I have tried the SVG converter code and I am finding that the conversion will not finish and I have to stop my program. I am using an svg file generated by a utility called emf2vec and I have used the sample code from your website for the encoding.

Also ideally what I would like is to do a straight conversion from a vector graphic wmf file to pdf but maintaining the vector graphic mode. I have used Aspose.PDF to convert from wmf to PDF but it appears to rasterise and I lose quality.

Regards

Tony

Hi Tony,

Thank you for sharing the details.

Can you please share some details regarding sample source code and template documents you are using or create a sample application to show the issue. This will help us to figure out the exact issue and reply back to you soon.

We apologize for your inconvenience.

Thanks & Regards,

Hi Rashid,


I really have just taken the code from your web site with modifications to set input and output as follows:

// instantiate LoadOption object using SVG load option
Aspose.Pdf.LoadOptions loadopt = new Aspose.Pdf.SvgLoadOptions();
// create Document object
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(“c:\imagemajick\emf2vec0.svg”, loadopt);
// save the resultant PDF document
doc.Save(OutputFilePath);

When I debug it all hangs after the Aspose.Pdf.Document doc = new Aspose.Pdf.Document(“c:\imagemajick\emf2vec0.svg”, loadopt); call.

The only real unknown is the svg file that we generated from a utility we found online.I have uploaded the file. Please note that it is an svg file but the uploader will not allow svg extensions so I had to change it.

Regards

Tony

Hi Tony,

Thanks for sharing the sample source code and template document with us.

I tested the scenario using your sample source code and source SVG file and able to notice that there might be an issue with your source file. I have also tested the scenario with another sample file and it's working fine. Source and resultant documents are attached for your reference.

Please feel free to contact support in case you need any further assistance.

Thanks & Regards,

Much appreciated Rashid. Your file indeed converts fine. All I really need now is something that can convert immediately from vector graphic wmf to vector graphic pdf. Although Aspose.PDF can convert SVG files to PDF it does not look as though it can go straight from vector graphic wmf to PDF without rasterising which loses quality.


Regards

Tony Hucks

Hello Tony,


Thanks for sharing the details.

As per my understanding, you have first converted the WMF file into SVG format and then you have tried using Aspose.Pdf for .NET to convert the SVG file into PDF format. The reason you are getting error while converting SVG file into PDF format is because you have used some online utility to convert EMF file to SVG format and as a result, the SVG file got corrupted.

Can you please share the source WMF file so that we can test the conversion at our end. We are sorry for your inconvenience.

Hi Rashid,


Can you confirm if Aspose.PDF can convert from WMF to PDF but maintaining the vector graphic format for quality reasons. As stated before it looks as though the WMF file is maybe being converted to PNG and then to PDF since quality is obviously reduced. If Aspose.PDF does not do this, is there any chance it may happen in the future?

Regards

Tony

Hi Tony,

Thanks for your inquiry. Kindly use the below mentioned code for converting WMF to PDF.

[C#]

//Instantiate Pdf instance by calling its empty constructor<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();

//Add a section into the pdf document

Aspose.Pdf.Generator.Section sec = pdf1.Sections.Add();

//Create a FileStream object to read the imag file

FileStream fs = File.OpenRead(@"d:\pdffiles\grid.wmf");

//Read the image into Byte array

byte[] data = new byte[fs.Length];

fs.Read(data, 0, data.Length);

//Create a MemoryStream object from image Byte array

MemoryStream ms = new MemoryStream(data);

//Create an image object in the section

Aspose.Pdf.Generator.Image imageht = new Aspose.Pdf.Generator.Image(sec);

//Set the type of image using ImageFileType enumeration

imageht.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Wmf;

//Specify the image source as MemoryStream

imageht.ImageInfo.ImageStream = ms;

//Add image object into the Paragraphs collection of the section

sec.Paragraphs.Add(imageht);

//Save the Pdf

pdf1.Save(@"d:\pdffiles\grid.pdf");

// Close the MemoryStream Object

ms.Close();

Please feel free to contact support in case you need any further assistance.

Thanks & Regards,

tonyhucks:
Can you confirm if Aspose.PDF can convert from WMF to PDF but maintaining the vector graphic format for quality reasons. As stated before it looks as though the WMF file is maybe being converted to PNG and then to PDF since quality is obviously reduced.
Hi Tony,

Sorry for the delay in response. I have logged this query as PDFNEWNET-33727 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Hi Nayyer,


I was wondering how the progress of this issue is going? You gave me an issue tracking number (PDFNEWNET-33727). Is this something I can use to follow the progress of the issue? If so how do I use it?

Regards

Tony Hucks

Hi Tony,

Thanks for your patience.

I have verified the status of this issue from our issue tracking system and regret to share that, this issue is still unresolved. Currently it is pending for analysis and is in the queue. Also, at the moment we can't provide you the ETA for this issue. However, I have requested the development team to share the ETA regarding its resolution. As soon as we get required information, we will be more than happy to update you with the status of correction. Please be patient and spare us little time.

We apologize for your inconvenience.

Thanks & Regards,

Hi Rashid,


Sorry to keep asking. In your last reply you mentioned asking the development team for an ETA regarding my issue. Do you have any more news?

Regards

Tony

Hi Tony,


Thanks for your patience.

Our development team is working hard on resolving this issue but I am afraid due to some technical difficulties, we are unable to determine the time-lines by which this issue will be fixed. Nevertheless, I have again sent an intimation to the development team to share any possible ETA. Once again, my humble request is to please share some estimated time lines by which this issue can be resolved.

We are really sorry for this delay and inconvenience.
tonyhucks:
Hi Rashid,

Sorry to keep asking. In your last reply you mentioned asking the development team for an ETA regarding my issue. Do you have any more news?
Hi Tony,

Sorry for the delay in response.

I have further discussed this issue with development team an as per our current estimates, we plan to get this issue resolved within current month and the HotFix will be included in next release version of Aspose.Pdf for .NET 7.3.0 (but still its not a promise. The resolution of issue depends upon the complexity of issue but our utmost priority will be to get this problem fixed by the said time). Once again, my humble request is to please be patient and spare us little time.

As soon as we have made some progress, we would be more than happy to keep you update on the status of correction.

Hi Guys,


Been a while now and I was wondering if I could have an update on this issue?

Regards

Tony

Hi Tony,


Thanks for your patience. I would like to inform you that our development team
has completed the analysis of your reported issue and the root cause has been
identified. However, the implementation of the fix of this issue has been
postponed till a later date due to other priority tasks and complexity of the issue. We will inform you as soon as this is resolved.

Sorry for the inconvenience faced.

Best Regards,