Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 27th, 2006, 02:37 AM
Registered User
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Metafile manipulation - any language will do

Hi!

Need your ideas urgently! I have a metafile which I wish to convert to PDF on the fly. The idea is to create a metafile template with placeholder text, which will be parsed and replaced by user information at runtime before generating the PDF. When editing the metafile, I have progressed to the following steps:

1. Called the Graphics.EnumerateMetaFile() method, which calls the callback method (lets call it ‘Play’)

2. Called the callback method and obtain the record data

public bool Play(EmfPlusRecordType recordType, int flags, int datasize, IntPtr data, PlayRecordCallback callback)
{
byte[] dataArray = null;
      if (data != IntPtr.Zero)
      {
              dataArray = new byte[datasize];
             Marshal.Copy(data, dataArray, 0, datasize);
      }

3. Checked whether the record pertains to writing text on the wmf as follows:

if (recordType == EmfPlusRecordType.DrawString)

4. Called the Metafile.PlayRecord() method to draw the new metafile.

mf.PlayRecord(recordType, flags, datasize, dataArray);

[u]
What I’m unable to do is, to parse the dataarray (which contains record data), such that I can replace existing text with new text.</u>


Thanks a LOT for any insights.

Regards,
Kunaal







Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Metafile to the Clipboard TMA_Master BOOK: Visual Basic 2008 Programmer's Reference ISBN: 978-0-470-18262-8 1 August 26th, 2008 10:59 PM
How to load metafile to memory nathan_nz C# 2005 2 July 15th, 2008 09:17 PM
Retrieving Picture Metafile Wizardio Word VBA 0 June 5th, 2006 07:55 AM
Time manipulation rajanikrishna Classic ASP Databases 1 May 11th, 2004 03:03 AM
String Manipulation twsinc Access 3 February 23rd, 2004 09:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.