Search Results

Search found 2 results on 1 pages for 'spiderdijon'.

Page 1/1 | 1 

  • Inverted colours in tiff to PDF conversion

    - by spiderdijon
    I'm sure I'm making some kind of silly mistake here, but when converting a tiff file to PDF, the colours become reversed. I can't figure out why. Here's my code: PdfWriter writer = PdfWriter.GetInstance(document, new FileStream("Image.pdf", FileMode.Create)); System.Drawing.Bitmap bm = new System.Drawing.Bitmap(@"C:\Temp\338814-00.tif"); int total = bm.GetFrameCount(FrameDimension.Page); document.Open(); PdfContentByte cb = writer.DirectContent; for (int k = 0; k < total; ++k) { bm.SelectActiveFrame(FrameDimension.Page, k); MemoryStream ms = new MemoryStream(); bm.Save(ms, ImageFormat.Tiff); Image img = Image.GetInstance(ms.ToArray()); img.ScalePercent(72f / (float)img.DpiX * 100); img.SetAbsolutePosition(0, 0); cb.AddImage(img); document.NewPage(); } document.Close(); Thanks.

    Read the article

  • Generated HTML word document not displaying image correctly

    - by spiderdijon
    I'm trying to add an image to a generated html word document that is embedded in a classic ASP page. The code looks something like this: <% Response.ContentType = "application/msword" %> <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word"> ... <v:shape id="_x0000_s1030" type="#_x0000_t75" style='position:absolute; left:0;text-align:left;margin-left:0;margin-top:17.95pt;width:7in;height:116.85pt; z-index:2;mso-position-horizontal:center;mso-position-horizontal-relative:page; mso-position-vertical-relative:page'> <v:imagedata src="http://xxx/image001.gif" o:title="image001"/> <w:wrap anchorx="page" anchory="page"/> <w:anchorlock/> </v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position: absolute;z-index:0;left:0px;margin-left:0px;margin-top:24px;width:672px; height:156px'><img width=672 height=156 src="http://xxx/image001.gif" v:shapes="_x0000_s1030"></span><![endif]> The image URL is correct and can be viewed through a browser, however when the word document opens, the image has a red x, with the error message: The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may be corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again. If i copy the html code and try to open the word document on my local machine, it displays the image correctly. It just doesn't work when retrieving the document from the server. This happens for any images I try to add. Is there another way to add images to html-generated word documents that can be output from an asp page? Thanks.

    Read the article

1