asp.net,pdf,itextsharp,invalidcastexceptionRelated issues-Collection of common programming errors
Tapas Bose
c# asp.net nhibernate spring.net mapping-resources
I am new in .NET. I have used Spring Framework and Hibernate before in Java, but this is my first in .NET. To develop my application I am using Spring.Northwind solution as example. The hibernate mapping is:<hibernate-mapping xmlns=”urn:nhibernate-mapping-2.2″><class name=”EMSApplication.Domain.Employee, EMSApplication.Domain” table=”ems_Employees” proxy=”EMSApplication.Domain.IEmployee, EMSApplication.Domain” lazy=”true”><id name=”Id” type=”System.Int32″><column name=”Id” n
ell
asp.net mono monodevelop dblinq xsp2
I am trying to try DBLinq with the sqlite provider inside a simple ASP.NET web service. I am also using MonoDevelop 2.4 and Mono 2.6.7, The project in monodevelop references the DbLinq.dll which by default is set to be Local Copy. I can compile the webservice just fine. By when I try to run it from Monodevelop or using the xsp2 from the command line, xsp2 fails with a number of errors (see below). If I unchecked the Local Copy for the DBLinq.dll reference, xsp2 will execute but the Li
John Adams
asp.net web-services coldfusion sax
We are a small team with one ASP.NET web developer and one ColdFusion developer. Neither of us knows the other’s environment. I wrote an ASMX webservice using Visual Studio 2005 and a web application project in Visual Studio 2008 that successfully consumes the web service. But now we are trying to have my ColdFusion colleague consume the webservice and we are getting results we cannot interpret (except to surmise that the target webservice is not even being reached but that some “system layer” u
Bradley Lederholz Leatherwood
asp.net razor mono nginx fastcgi
Hello so I have been trying to get my website to run on mono (on ubuntu server) and I have followed these tutorials almost to the letter:However when my directory is not blank fastcgi logs reveal this: Notice Beginning to receive records on connection.Error Failed to process connection. Reason: Exception has been thrown by the target of an invocation.I am not really sure what this means, and depending on what I do I can get another error that tells me the resource cannot be found:The resource
Sabre
c# asp.net .net internet-explorer
I have a MVC web application that uses the 2010 report viewer. written in C# VS2010IE11 users are having difficulty loading the page containing the control, it sits indefinitely on the “Loading…” indicator.I have managed to track this down to others having similar issues with the user agent being the culprit.So to test I pulled up the development tools, changed the user agent to anything other than default, and viola, page loaded without issue.So all of the typical ways to address this such as
sshackles
asp.net c#-4.0 active-directory ldap
I have created a login page in asp.net using c# but I am having difficulty trying to only allow a certain group to have access. Right now I am accessing everyone but I can’t seem to just filter the group that I need so only those person(s) can have access to my application.Any help would be great so I can just permission this application out to that one group within Active Directory.Here is my class that I am using to pass the groups:public class LdapAuthentication {private string _path;private
Jon
asp.net sql-server-2005 database-connection
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)Hello I am new on developing on SQL Server 2005. I’ve worked for several years with SQL Server 2000, but after doing the usual stuff I do to connect to the server I get this exception on the
user2668128
c# asp.net .net asp.net-web-api
I have created a basic ASP.NET Web Api Application inside VS Express 2013 using all of the defaults. I added a controller and it returns XML just as I want.As soon as I install the CORS package:Install-Package Microsoft.AspNet.WebApi.Cors -PreI can’t even run the application anymore:An exception of type ‘System.IO.FileLoadException’ occurred in mscorlib.dll and wasn’t handled before a managed/native boundaryAdditional information: Could not load file or assembly ‘System.Web.Http, Version=5.0.0.0
Mtblewis
php asp.net wordpress authentication single-sign-on
I am attempting to create a single sign on experience between an asp.net site and a wordpress site using a simple form POST method. I have built a simple php page that uses the native wordpress functions wp_insert_user and wp_signon to create user account in the mysql db and sign them in. In my asp.net ‘create new user’ page code behind, I’m using the post method of an HttpWebRequest to send the required information to the php page. It almost works! The new wordpress user is created in the mysql
Mr Moo
asp.net asp.net-mvc sql-server-2008 nhibernate ninject
We have an ASP.Net 4 / MVC 3 hybrid web application which uses NInject 3 and (Fluent) NHibernate 3.2. DB is SQL Server 2008 R2. Server is 6-core 28 GB Windows 2008 64-bit server.Our customer has recently started testing the site using a spidering tool. As soon as the site experiences the load produced by the spider, our log starts to fill up with exceptions. We see a variety of errors from NHibernate, including some of the following:NHibernate.TransactionException: Commit failed with SQL excep
ingsaurabh
android pdf build jni android-ndk
when running the program open a second but not show any content of PDF file, it has only UI button and black BG , and close itself in next time btw I build muPDF version 0.8.165 using ndk-r5b and run in android 2.2in my LogCat06-01 12:21:18.953: DEBUG/AndroidRuntime(4984): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< 06-01 12:21:18.953: DEBUG/AndroidRuntime(4984): CheckJNI is OFF 06-01 12:21:18.953: DEBUG/
Davide.77
asp.net-mvc-3 pdf fonts itextsharp font-face
I’m not able to find a reason why my MVC 3 web site shows arabic font correctly and my pdf not.I use a bliss font in my web site;@font-face { font-family: ‘blissregular’; src: url(‘/Fonts/blissregular-webfont.eot’); src: url(‘/Fonts/blissregular-webfont.eot?#iefix’) format(’embedded-opentype’),url(‘/Fonts/blissregular-webfont.ttf’) format(‘truetype’); font-weight: normal; font-style: normal;}All working fine. After that I want to create the pdf of the output but arabic fonts does not appears.I’v
anarchos78
pdf solr indexing
I am trying to index data from pdf now, and I am getting the following response from Solr:<response> <lst name=”responseHeader”> <int name=”status”>0</int> <int name=”QTime”>1</int> </lst> <lst name=”initArgs”> <lst name=”defaults”> <str name=”config”>data-config.xml</str> </lst> </lst> <str name=”command”>full-import</str> <str name=”status”>idle</str> <str name=”importResponse”/> <lst
Kremlito
pdf character-encoding indesign text-extraction truetype
I am trying to extract text from a pdf book and continue to run an issue where sections of copied text fail to retain the proper capitalization properties when pasted into a text document. I have rights to reproduce the book and also have a license to use all necessary fonts. At first I thought that the issue was caused by the fonts not being embedded, but I checked and all fonts appear to be subset embedded. Within the pdf there are over 100 fonts used which have one of the following properties
SAM
java pdf hadoop yarn
I want to parse PDF files in my hadoop 2.2.0 program and I found this, followed what it says and until now, I have these three classes:PDFWordCount: the main class containing map and reduce functions. (just like native hadoop wordcount sample but instead of TextInputFormat I used my PDFInputFormat class. PDFRecordReader extends RecordReader<LongWritable, Text>: Which is the main work here. Especially I put my initialize function here for more illustration.public void initialize(InputSplit
Rafat touqir Rafsun
java android pdf jni mupdf
I’ve been working on a Android project where I’m using MuPDF forPDF to TEXT extraction,but sometimes the extracted Words are in Wrong Layoutpublic synchronized TextWord [][] textLines(int page) {gotoPage(page);TextChar[][][][] chars = text();// here text() method is the native methodArrayList<TextWord[]> lns = new ArrayList<TextWord[]>();for (TextChar[][][] bl: chars) {for (TextChar[][] ln: bl) {ArrayList<TextWord> wds = new ArrayList<TextWord>();TextWord wd = new TextWor
Jon Adams
c# excel pdf
I am looking for a MsExcel (.xsl and .xlsx) to PDF converter/library or API. I want it for my C# .Net application.I like commercial libraries, but can’t afford much.
user3412670
java pdf timestamp itext bouncycastle
I am using IText 4.2.0 and bcprov-jdk15-1.43.jar and bctsp-jdk15-1.43.jar for signing pdf. I added these jars by add external jars button in Eclipse. When I execute it gives me following error.ExceptionConverter: java.lang.Exception: Failed to get TSA response from tsaURL at com.lowagie.text.pdf.TSAClientBouncyCastle.getTimeStampToken(TSAClientBouncyCastle.java:185) at com.lowagie.text.pdf.TSAClientBouncyCastle.getTimeStampToken(TSAClientBouncyCastle.java:136) at com.lowagie.text.pdf.PdfPKCS7.ge
Dadles
c# pdf windows-8 winrt-xaml
I want to be able to open a PDF using the native Windows Reader Application when a user clicks on a button. So far I am able to use the following code to successfully open files that end with the (.PNG) extension. However, when I let the link to open the (.PDF) file I get the following error.The system cannot find the file specified. (Exception from HRESULT: 0x80070002)The file destination is correct.Here is my code:private async void btnLoad_Click(object sender, RoutedEventArgs e){// Path to th
user2056563
c# silverlight pdf windows-phone-8 windows-phone
I have few pdf in a folder say Data/PDF/abc.pdf.I am trying to open PDF with the below code:private async void LaunchPDFNew(string name){string imageFile = @”Data/PDF/”+name+”.pdf”;// Get the image file from the package’s image directoryvar file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile);if (file != null){bool success = await Windows.System.Launcher.LaunchFileAsync(file, options);if (success){// File launchedDebug.WriteLine(“File Launched”);}else{/
Davide.77
asp.net-mvc-3 pdf fonts itextsharp font-face
I’m not able to find a reason why my MVC 3 web site shows arabic font correctly and my pdf not.I use a bliss font in my web site;@font-face { font-family: ‘blissregular’; src: url(‘/Fonts/blissregular-webfont.eot’); src: url(‘/Fonts/blissregular-webfont.eot?#iefix’) format(’embedded-opentype’),url(‘/Fonts/blissregular-webfont.ttf’) format(‘truetype’); font-weight: normal; font-style: normal;}All working fine. After that I want to create the pdf of the output but arabic fonts does not appears.I’v
H H F
c# itextsharp
I have one PDF form which is filled by supervisor(or a user). I want to merge generated PDFs. I have done simple merging but in it i have to first generate multiple files and then merge them. Is there any way that when user fills multiple forms and then at the time of final submission or printing i get only a single merged of all filled PDFs.
Dmitry
itextsharp itext watermark pdfstamper
I’m lost at the moment. What I try to accomplish is adding one PDF on another (like a watermark). The problem is that I dont seems to understand the coordinate system that is used because my watermark just behaves unexpected.The two PDFs have different dimensions.My target has the following dimensions: 595 height 842 width The PDF that shall be added has this dimension: 41 height 552 widthIn my code I do the following:public bool AddPdf(ref PdfReader pdfSource, ref PdfReader pdfTarget, ref File
Charles Stewart
pdf pdf-generation embed itextsharp imposition
I need to programmatically embed an existing PDF (a small graphic) onto a specfic page on an existing PDF. Using iTextSharp I’ve been able to add a new page containing this embedded PDF, but what need is to modify an existing page by adding this graphic. Is this possible using iTextSharp or any other PDF-generation libarary?
acadia
c# itextsharp
I am using the below function to split the pdf into two.Though it is spliting the pdf, the content is appearing upside down. How do I rotate it by 180 degrees. Please help. below is the code for the sameprivate static void ExtractPages(string inputFile, string outputFile,int start, int end){// get input documentPdfReader inputPdf = new PdfReader(inputFile);// retrieve the total number of pagesint pageCount = inputPdf.NumberOfPages;if (end < start || end > pageCount){end = pageCount;}// loa
Mark Storer
c# pdf itextsharp text-extraction
System.ArgumentException was unhandled by user codeMessage=Unexpected color space /R11Source=itextsharpStackTrace:at iTextSharp.text.pdf.parser.InlineImageUtils.GetComponentsPerPixel(PdfName colorSpaceName)at iTextSharp.text.pdf.parser.InlineImageUtils.ComputeBytesPerRow(PdfDictionary imageDictionary)at iTextSharp.text.pdf.parser.InlineImageUtils.ParseUnfilteredSamples(PdfDictionary imageDictionary, PdfContentParser ps)at iTextSharp.text.pdf.parser.InlineImageUtils.ParseInlineImageSamples(PdfDic
Anton Putov
c# itextsharp
Here is known code that splits PDF document:try{FileInfo file = new FileInfo(@”d:\?.pdf”);string name = file.Name.Substring(0, file.Name.LastIndexOf(“.”));// we create a reader for a certain documentPdfReader reader = new PdfReader(@”d:\?.pdf”);// we retrieve the total number of pagesint n = reader.NumberOfPages;int digits = 1 + (n / 10);System.Console.WriteLine(“There are ” + n + ” pages in the original file.”);Document document;int pagenumber;string filename;for (int i = 0; i < n; i++){page
Gray
c# pdf-generation itextsharp
I am new in using this library and I found several examples (I am splitting PDF by page):code source 1 code source 2 code source 3But always when somebody begin use Filestream erors occurs (Object reference not …). While creating Filestream no one eror occurs. Whats wrong? Library I have downloaded here. EDITprivate static void Test(){Document pdfDocument = new Document( );PdfWriter.GetInstance(pdfDocument,new FileStream(“D:\\WDPT.PDF”, FileMode.Create));// here is erorpdfDocument.Open( );pdfD
Hoverfrog
wpf itextsharp
I’m trying to create a pdf document using iTextSharp 5.3.4 using the followingDocument document = new Document(); FileStream stm = new FileStream(filename, FileMode.Create); PdfWriter writer = PdfWriter.GetInstance(document, stm);I’m getting a System.NullReferenceException with the following stack trace:System.NullReferenceException occurred HResult=-2147467261 Message=La référence d’objet n’est pas définie à une instance d’un objet. Source=itextsharp StackTrace:à iTextSharp.text.Version.GetInst
Satinder singh
c# asp.net pdf pdf-generation itextsharp
I am generating PDF from my DataTable using iTextSharp version 5.3.5 in asp.net c#. My DataTable contain unkown rows, sp while PDF generating if it take more then one page i need to fix some header and footer for each page Code:public DataTable dataTable; protected void Page_Load(object sender, EventArgs e){dataTable = getData();Document document = new Document(PageSize.A4, 10, 10, 90, 10);string path = Server.MapPath(“PDFs”);PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(pat
townsean
wpf tooltip invalidcastexception
I need to makes some changes to a ToolTip programmatically. That sounds simple enough. Well, apparently not really. :/I have a ToolTip on a WindowsFormsHost object and I make the following cast to get to the IsOpen property: ((System.Windows.Controls.ToolTip)host.ToolTip).IsOpen = true;This line fails during runtime with an InvalidCastException. Unable to cast object of type ‘System.String’ to type’System.Windows.Controls.ToolTip’.I don’t understand why this is failing. I must be missing som
Nich0ls
c# vb.net linq nhibernate invalidcastexception
:I have a problem… I opted to use NHibernate 3.3.3 sources instead of the pre-compiled DLL because I’m getting sick of having NHibernate issues and not be able to debug them (ie black box). I did the same with fluent NHibernate.I tested the source I compiled for fluent NHibernate with the precompiled NHibernate DLL and it worked. So I decided to go further and do the same with NHibernate.This is where it sucks : my app starts, search engine vorks, etc… BUT every time I try to save something,
Charlie Salts
c# plugins interface late-binding invalidcastexception
I’ve done this before in C# for a plugin system which works fine, which is why I’m puzzled as to why this new, separate plugin system is not working the way I would expect.I have my plugin assembly – let’s call it “plugin.dll” and I have my main assembly – let’s call it App.exe. I have an interface called IMyObject and its implementation, MyObject and both are defined in plugin.dll. I’ve copied the exact code file for IMyObject (which the plugin developer has provided to me) into my main App.ex
Jeremy Wiggins
c# exception compiler compilation invalidcastexception
Possible Duplicate:Compile-time and runtime casting c# As I understand it, the following code will always compile, and will additionally always fail at run-time by throwing an InvalidCastException. Example:public class Post { } public class Question : Post { } public class Answer : Post {public void Fail(){Post p = new Post();Question q = (Question)p; // This will throw an InvalidCastException} }My questions are…If my assumptions are off, then can someone provide an example demonstrating ho
ElGaucho
c# reflection dll assemblies invalidcastexception
We’re loading assemblies dynamically on demand by reflection By now, we’ve defined five dll’s and all have been preloaded by Assembly.LoadFile(). In one of these assemblies, we have a defined an interface IDeviceConnection, which inherits from IConnection (which is defined in a contracts project that is used by the application and the assemblies).We have managed to create an instance of ParameterManager, which is defined in the exact same dll as the IDeviceConnection interface. But as soon as we
Mike Wills
c# model invalidcastexception
I work a ton with our IBM i data and I can’t use EF to work with that data. So instead I do something similar to the following:DataTable dt = new DataTable(); using (iDB2Connection conn = new iDB2Connection(_connString)) {using (iDB2Command cmd = new iDB2Command(sb.ToString(), conn)){conn.Open();using (iDB2DataAdapter da = new iDB2DataAdapter(cmd)) { da.Fill(dt); }conn.Close();} }From there I can model the data by doing:var billHistory = from i in dt.AsEnumerable()select new BillHistory{Customer
sleekFish
c# java weka invalidcastexception
I am currently working on a project in which I need to use FP-Growth algorithm. I know Weka is a handy tool for it. However, I am using C# for coding (due to some other libraries I need). So, I converted weka.jar to weka.dll using IKVM.NET. Below is a code snippet that i have written:FPGrowth FPMiner = new FPGrowth();FPMiner.buildAssociations(dataset);AssociationRules rules = FPMiner.getAssociationRules();List<AssociationRule> rule = rules.getRules();This gives me an error as:Cannot implic
user2588873
asp.net pdf itextsharp invalidcastexception
I have several ASPX web forms that have many text boxes, radio button lists, combo boxes, and many other fancy Telerik controls. After a page is filled out and the submit button is clicked the whole page needs to be converted to a PDF. I need examples of how I could possibly do this with iTextSharp. I have been messing around with a Test project to see how it works and got the following exception when I added a RadTextBox and a RadComboBox:Unable to cast object of type ‘iTextSharp.text.html.simp
Peter Wimmer
c# com invalidcastexception
I would like to implement a COM object in C# and also use it in C# (besides C++ and others).Here is the code of the DLL implementing the COM object :namespace TestComServer {[ComVisible(true),Guid(“565D8202-6C0F-4AAB-B0F6-49719CD13045”),InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]public interface ITestObject {void DoSomething();}[ComVisible(true),GuidAttribute(“21293767-A713-49E2-968E-7DDE0B0DAB94”),ClassInterface(ClassInterfaceType.None)]public class TestObject : ITestObject {public Tes
J0NNY ZER0
c# asp.net-mvc-3 invalidcastexception
Anyone know how to remedy this error?Specified cast is not valid.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Specified cast is not valid.Here is the line of code where it breaks – var id = (int)httpContext.Request.RequestContext.RouteData.Values[“id”];
Web site is in building