We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

get_Width Exception

Thread ID:

Created:

Updated:

Platform:

Replies:

23672 Jan 18,2005 05:45 AM UTC Jan 21,2005 11:49 AM UTC WinForms 4
loading
Tags: PDF
Shaun Wilson
Asked On January 18, 2005 05:45 AM UTC

Hi. I have a 300dpi scanned image I''m trying to create a PDF from. Image is a TIF file format. I open it manually using .NET, then I get the width and obtain the inches based on image dpi (300 in thie case, the resulting document dimensions are 8.5"x11"). I take these dimensions and multiply them by 72, to aquire a point value. I do this because I assume I have to. Then I Create a PDFDocument, remove the default page, then create a new page with the dimensions I''ve calculated. Then I specify that I want my image to take up the entire space of the page I just created. I use the same SizeF structure used to create the page. I get the following exception (reflection dump): Message= Invalid parameter used. TargetSite= Int32 get_Width() StackTrace= at System.Drawing.Image.get_Width() at Syncfusion.Pdf.Implementation.Objects.PDFImage.get_Width() at Syncfusion.Pdf.Implementation.Objects.PDFImage.AddRequiredItems() at Syncfusion.Pdf.Implementation.Objects.PDFImage.SaveObject(IPDFWriter writer) at Syncfusion.Pdf.Implementation.Objects.PDFObject.Save(IPDFWriter writer) at Syncfusion.Pdf.Implementation.Objects.PDFIndirectObject.SaveObject(IPDFWriter writer) at Syncfusion.Pdf.Implementation.Objects.PDFObject.Save(IPDFWriter writer) at Syncfusion.Pdf.PDFDocument.SaveIndirectObject(IPDFObject pdf, IPDFWriter stream, IPDFCompressor compressor) at Syncfusion.Pdf.PDFDocument.SaveIndirectObject(IPDFObject pdf, IPDFWriter stream) at Syncfusion.Pdf.PDFDocument.SaveImages(IPDFWriter stream) at Syncfusion.Pdf.PDFDocument.Save(IPDFWriter stream) at Syncfusion.Pdf.PDFDocument.Save(String fileName) at Infocus.ExportApi.ExportWorker.CreatePdfDocument(Guid documentId, IList fileListing, String storagePath, StatusHelper statusHelper) in c:\code\infocus\infocus.exportapi\infocus.exportapi\exportworker.cs:line 282 Source= System.Drawing Any suggestions at allwould be appreciated. I can provide sample source code as the total pdf code is only maybe 10 lines or so. If I do not attempt to draw the image to the document everything works ok, except the result pdf page has no image (blank page). Thanks!

Administrator [Syncfusion]
Replied On January 20, 2005 04:51 PM UTC

Hi Shaun, Currently there is no support for inserting TIF images, so i would assume that this is whats causing the exception. We will add support for TIF images within two weeks time. If possible, please create a Direc-Trac incident with the sample TIF file that you are trying to insert. Thanks. Best regards, Stephen. >Hi. I have a 300dpi scanned image I''m trying to create a PDF from. > >Image is a TIF file format. I open it manually using .NET, then I get the width and obtain the inches based on image dpi (300 in thie case, the resulting document dimensions are 8.5"x11"). > >I take these dimensions and multiply them by 72, to aquire a point value. I do this because I assume I have to. > >Then I Create a PDFDocument, remove the default page, then create a new page with the dimensions I''ve calculated. > >Then I specify that I want my image to take up the entire space of the page I just created. I use the same SizeF structure used to create the page. > >I get the following exception (reflection dump): > > Message= Invalid parameter used. > TargetSite= Int32 get_Width() > StackTrace= at System.Drawing.Image.get_Width() > at Syncfusion.Pdf.Implementation.Objects.PDFImage.get_Width() > at Syncfusion.Pdf.Implementation.Objects.PDFImage.AddRequiredItems() > at Syncfusion.Pdf.Implementation.Objects.PDFImage.SaveObject(IPDFWriter writer) > at Syncfusion.Pdf.Implementation.Objects.PDFObject.Save(IPDFWriter writer) > at Syncfusion.Pdf.Implementation.Objects.PDFIndirectObject.SaveObject(IPDFWriter writer) > at Syncfusion.Pdf.Implementation.Objects.PDFObject.Save(IPDFWriter writer) > at Syncfusion.Pdf.PDFDocument.SaveIndirectObject(IPDFObject pdf, IPDFWriter stream, IPDFCompressor compressor) > at Syncfusion.Pdf.PDFDocument.SaveIndirectObject(IPDFObject pdf, IPDFWriter stream) > at Syncfusion.Pdf.PDFDocument.SaveImages(IPDFWriter stream) > at Syncfusion.Pdf.PDFDocument.Save(IPDFWriter stream) > at Syncfusion.Pdf.PDFDocument.Save(String fileName) > at Infocus.ExportApi.ExportWorker.CreatePdfDocument(Guid documentId, IList fileListing, String storagePath, StatusHelper statusHelper) in c:\code\infocus\infocus.exportapi\infocus.exportapi\exportworker.cs:line 282 > Source= System.Drawing > >Any suggestions at allwould be appreciated. I can provide sample source code as the total pdf code is only maybe 10 lines or so. If I do not attempt to draw the image to the document everything works ok, except the result pdf page has no image (blank page). > >Thanks! >

Shaun Wilson
Replied On January 20, 2005 11:56 PM UTC

Still no dice. Maybe I need to look at alternatives. Or maybe someone has a support mailing address, I was unable to locate one on the website. Thanks.

Shaun Wilson
Replied On January 21, 2005 12:10 AM UTC

>Currently there is no support for inserting TIF images, I saw this as the bulk of overloads for loading from a file stated that. However I have opened the TIF image into a .NET Bitmap object. I assumed this warning was targeting those user who were most interested in specifying a .TIF file as the filename property to drawimage. I thought that by loading the image myself, it would not matter. Tomorrow I will try and load a JPEG instead, then a BMP file. Does Essential PDF still care that the original file was a .TIF, I was not aware that the .NET Bitmap object would carry that kind of information arround. With this new information I will create a copy of my Bitmap object manually. If that doesn''t solve the problem, maybe there''s a deeper issue that has nothing to do with the file format, but maybe with the pixel format. Can Essential PDF consume indexed images (such as a 1bpp bitmap)? > [...] i would assume that this is whats causing the exception. We will add support for TIF images within two weeks time. That''s good news, I was surprised to see such limited support in Essential PDF, after all .NET itself allows developers to work with at least 6 different file formats. The only core limitations are on its ability to write to indexed DIB surfaces. > If possible, please create a Direc-Trac incident with the sample TIF file that you are trying to insert. Thanks. I will put together a small sample application for your staff. Currently we have TIF, PNG, EWF, PCX, BMP, GIF and JPEG file formats in our system. I will provide sample media for each format as well. I have put off testing Essential PDF until I received a response. I will test all other file formats here as well, and send my test app along to te Direc-trac (?) web. >Best regards, > >Stephen. One last question. Is the source code to Essential PDF available with the source code purchase option of the suite? (I think I saw a source code option, I may be mistaken). Thanks.

Administrator [Syncfusion]
Replied On January 21, 2005 11:49 AM UTC

Hi Shaun, We were able to reproduce this issue with a file that another customer had set us. Its a bug in the current version. We will fix this bug within a day or two and have an updated build available for download. You can also use Direc-Trac for submitting support incidents. http://www.syncfusion.com/Support/DirectTrac/logon.aspx?URL=/Support/DirectTrac/default.aspx Thanks. Best regards, Stephen. >>Currently there is no support for inserting TIF images, > >I saw this as the bulk of overloads for loading from a file stated that. However I have opened the TIF image into a .NET Bitmap object. I assumed this warning was targeting those user who were most interested in specifying a .TIF file as the filename property to drawimage. > >I thought that by loading the image myself, it would not matter. > >Tomorrow I will try and load a JPEG instead, then a BMP file. > >Does Essential PDF still care that the original file was a .TIF, I was not aware that the .NET Bitmap object would carry that kind of information arround. > >With this new information I will create a copy of my Bitmap object manually. If that doesn''t solve the problem, maybe there''s a deeper issue that has nothing to do with the file format, but maybe with the pixel format. > >Can Essential PDF consume indexed images (such as a 1bpp bitmap)? > > >> [...] i would assume that this is whats causing the exception. We will add support for TIF images within two weeks time. > >That''s good news, I was surprised to see such limited support in Essential PDF, after all .NET itself allows developers to work with at least 6 different file formats. The only core limitations are on its ability to write to indexed DIB surfaces. > >> If possible, please create a Direc-Trac incident with the sample TIF file that you are trying to insert. Thanks. > >I will put together a small sample application for your staff. Currently we have TIF, PNG, EWF, PCX, BMP, GIF and JPEG file formats in our system. I will provide sample media for each format as well. I have put off testing Essential PDF until I received a response. I will test all other file formats here as well, and send my test app along to te Direc-trac (?) web. > >>Best regards, >> >>Stephen. > >One last question. Is the source code to Essential PDF available with the source code purchase option of the suite? (I think I saw a source code option, I may be mistaken). > >Thanks. >

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;