JPEG to PDF

Nov 12, 2010 at 11:38 PM

Do you have a sample showing how to create a PDF from a JPEG on a webserver?

Thanks.

Nov 13, 2010 at 2:09 AM

I figured it out using a WebClient:

XImage jpeg = XImage.FromStream(e.Result as Stream);

 

 

 

 

 

 

Nov 15, 2010 at 5:32 PM

Hello!

I'm working on write a Header and Footer on a PDF.

My question is, what is in your example: "e.Result as Stream"?

I have two image, one for header, and one for footer.

Can you help me?

How I "convert" these on sreams?

Thx!

Nov 22, 2010 at 10:47 PM

Hi,

I've been working on the silmilar stuff. I think he used WebClient. I used like this.. hope it helps you.

 

            WebClient wc = new WebClient();
            wc.OpenReadCompleted += new OpenReadCompletedEventHandler(wc_OpenReadCompleted);
            wc.OpenReadAsync(new Uri("Your Http Uri"));

 

        void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                MessageBox.Show(e.Error.Message);
            }
            else
            {
                Stream mystream = e.Result;  // here
            }
        }