Screenshot Preview

PDFView4NET WPF & Silverlight Edition - Support

by O2 Solutions - Product Type: Component / .NET Class / .NET WPF / Silverlight

Support Forum

Using PDFRender4Net in a web servce. lom200 [Russia] 06-Mar-2013 11:39:24

O2S.Components.PDFRender4NET.WPF.dll from pdfview4net430wpfsl.msi

We need to print pdf into images in a web servce.

Unit test session works fine:
var pageImage = file.GetPageImage(i, dpi, dpi, PDFOutputImageFormat.PNG);

Web service throws a ZamplParseException: 'The invocation of the constructor on type 'System.Windows.Controls.Canvas' ...
Inner Exception is "The calling thread must be STA, because many UI components require this."

Wrap it in STA. We get Out of memory exeption on this line : var pageImage = file.GetPageImage(i, dpi, dpi, PDFOutputImageFormat.PNG);


System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(delegate
{
for (int i = 0; i < file.PageCount; i++)
{

var pageImage = file.GetPageImage(i, dpi, dpi, PDFOutputImageFormat.PNG);

var img = new Bitmap(pageImage);
img.Save(string.Format(outputDirectory + "\\image{0}.png", i.ToString("D4")), ImageFormat.Png);



}
}));
thread.SetApartmentState(System.Threading.ApartmentState.STA);
thread.Start();
thread.Join();


How do we make it work in a web service?
Reply


PDFView4NET WPF & Silverlight Edition eremenko.a [Russia] 25-May-2012 08:38:15

We've got a trouble! we need links in PDF files to be supported in our app, and moreover we need to preview it executing being able to cancel one. We are using your component and it seems to have all the required events, but none of them work!(( Help, AsAp.
Reply


PDFView4NET WPF & Silverlight Edition aaron.wallin [CA, USA] 04-Apr-2012 16:45:10

I need to be able to drag and drop onto fields. Is there a simple mechanism that will allow me to detect when I am dragging something onto the PDFPageView control that the object being dragged is over a field and then drop onto that field?
Reply


Product Search

Enter search words:

The Software Superstore for IT Professionals

As Official Distributors, ComponentSource offers convenient, one-stop shopping from 250+ Software Publishers specializing in Application Development & Operations.

More Info | About Us

Award