Solved! Go to Solution.
Hello everyone,
I know it is something related to silverlight i just post it if anybody has answer then he or she can help me.
everything is working fine in my application but I noticed that XAP file is getting bigger and bigger I have used silverpdf.dll which size is around 2 mb if i remove it from project than xap file will reduce by 800 kb.but i am using many methods of that dll.I create class library but the xap file is same
so any body know that how to add third party dll in reference with out changing xap file size?
Please help,
Thanks
Foram
Hello everyone,
I know it is something related to silverlight i just post it if anybody has answer then he or she can help me.
everything is working fine in my application but I noticed that XAP file is getting bigger and bigger I have used silverpdf.dll which size is around 2 mb if i remove it from project than xap file will reduce by 800 kb.but i am using many methods of that dll.I create class library but the xap file is same
so any body know that how to add third party dll in reference with out changing xap file size?
Please help,
Thanks
Foram
AssemblyPart apSilverPDF; System.IO.Stream PDFStream; /// <summary> /// Load the silverPDF library if it hasn't been loaded already /// or use the library if already loaded /// </summary> public void LoadPDFLibraryAndSaveFile() { SaveFileDialog savePDF = new SaveFileDialog(); savePDF.Filter = "PDF file format|*.pdf"; savePDF.DefaultExt = ".pdf"; if (savePDF.ShowDialog() == true) { //catch the error if the user tries to save over a file that is currently open try { PDFStream = savePDF.OpenFile(); //if silverPDF library is not loaded already, load it if (apSilverPDF == null) { LoadPDFLibrary(); } else { //if the library is loaded, just save the PDF file SavePDF(); } } catch (IOException ioe) { //tell the user the file is open MessageBox.Show("Selected PDF file is open. Close the file and try again!", "Open File Error", MessageBoxButton.OK); } } } /// <summary> /// Send a request to load the silverPDF library dynamically /// </summary> private void LoadPDFLibrary() { WebClient client = new WebClient(); client.OpenReadCompleted += new OpenReadCompletedEventHandler(client_OpenReadCompleted); Uri _uri = new Uri("silverPDF.dll", UriKind.Relative); client.OpenReadAsync(new Uri("silverPDF.dll", UriKind.Relative)); } /// <summary> /// Load the library and use it to create the PDF /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) { if ((e.Error == null) && (e.Cancelled == false)) { apSilverPDF = new AssemblyPart(); apSilverPDF.Load(e.Result); SavePDF(); } else { MessageBox.Show("There was a problem loading PDF Library", "PDF Library Loading Error", MessageBoxButton.OK); } }