Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

Last post 09-16-2009, 11:26 PM by aspose.notifier. 29 replies.
Page 1 of 2 (30 items)   1 2 Next >
Sort Posts: Previous Next
  •  04-23-2009, 9:35 AM 176261

    Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf .NET

    Hi,

    I am trying to create a word document  and then save it to pdf using the code below.  finalOuput is a string in wordml format.  This all works fine.  I have been trying to deploy to Microsoft Azure.  On this platform the wordDocument.PageCount returns an OutOfMemoryException as does wordDocument.SaveToPdf().  Is there anything in these properties/methods that needs access to the file system or require some form of special permissions?  Do you know of anything that would be causing them to throw this exception.

    MemoryStream openStream = new MemoryStream(Encoding.UTF8.GetBytes(finalOutput));
    Document wordDocument = new Document(openStream, null, loadFormat, null);
                  
    MemoryStream pdfStream = new MemoryStream();
    wordDocument.SaveToPdf(0, wordDocument.PageCount, pdfStream, new Aspose.Words.Rendering.PdfOptions());

    Best regards

    David

     
  •  04-23-2009, 2:27 PM 176401 in reply to 176261

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Hi Alexey,

     

    I was speaking to you today about a memory exception I was getting while trying to run aspose.words on windows azure.  I’ve created a very simple page that has the following code on the page_load.  I created a simple docx that has one line of text.  When I run the following i get the error below.  I thought i’d send this to you to see if it gives you any clues as to why it might be throwing the error.

     

    Document doc = new Document(Server.MapPath("in.docx"));

    Response.Write("page count: " + doc.PageCount);

     

     

    System.OutOfMemoryException was unhandled by user code

      Message="Out of memory."

      Source="System.Drawing"

      StackTrace:

           at System.Drawing.Graphics.FromHwndInternal(IntPtr hwnd)

           at System.Drawing.Graphics.FromHwnd(IntPtr hwnd)

           at ..get_()

           at ..ࢮ(String ݺ, Font ࢴ)

           at ..ࢮ(String ݺ)

           at ..get_()

           at ..get_ދ()

           at ..()

           at ..()

           at ..()

           at ..( )

           at ..( , , )

           at ..( , )

           at ..( , )

           at ..( , )

           at ..( )

           at ..()

           at ..()

           at ..()

           at .ӡ.(Document , Ӣ )

           at Aspose.Words.Document.UpdatePageLayout()

           at Aspose.Words.Document.get_ӡ()

           at Aspose.Words.Document.get_PageCount()

           at Factonomy.AzureSpeedTest_WebRole.Aspose.Page_Load(Object sender, EventArgs e) in C:\Projects\Factonomy.AzureSpeedTest\Factonomy.AzureSpeedTest\Factonomy.AzureSpeedTest_WebRole\Aspose.aspx.cs:line 17

           at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)

           at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)

           at System.Web.UI.Control.OnLoad(EventArgs e)

           at System.Web.UI.Control.LoadRecursive()

           at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

      InnerException:

     

     

     

    Best regards

    David


    This message was posted using Email2Forum by alexey.noskov.
     
  •  04-23-2009, 4:05 PM 176432 in reply to 176401

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Hi David,

     

    Thanks you for additional information. I will consult with our developers regarding this issue and provide you more information.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  04-24-2009, 5:02 AM 176519 in reply to 176432

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Hi David,

     

    I logged this problem in our defect database as issue #8641. We will further investigate the issue and provide you more information.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  05-19-2009, 5:13 AM 180339 in reply to 176519

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Hi,

    I was wondering if there was any more information about this issue as it is holding us up from using ASPOSE on projects even though we have bought a full license.

    I have posted the same issue on the Windows Azure forums and got this answer.

    "We feel it may be due to continuously memory being consumed up during access of the link. This can be fixed by disposing the Graphics object instance used in the code. Can you please give a try doing this and confirm us if this really helps?"

    I don't know if this is any help but thought i'd get back to you with it anyway.

    If you could let me know of any changes to the status of this defect.

    Best regards
    David

     
  •  05-19-2009, 6:03 AM 180351 in reply to 180339

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Hi David,

     

    Thank you for additional information. Unfortunately, the issue is still unresolved.

    Yesterday we have released new version of Aspsoe.Words. Did you try it? You can download Aspose.Words 6.4.0 from here:

     http://www.aspose.com/community/files/51/file-format-components/aspose.words-for-.net-and-java/entry180062.aspx

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  05-19-2009, 7:45 AM 180383 in reply to 180351

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Hi Alexey,

    I have just tried the latest version of Aspose.Words and it still doesnt work.  It throws exactly the same exception.  Do you have any idea of timescales on when this might be looked at as it's quite urgent for us.

    Best regards
    David

     
  •  05-19-2009, 2:42 PM 180437 in reply to 180383

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Hi David,

     

    Thanks for your request. Unfortunately, I cannot provide you any estimate regarding this issue at the moment.

     

    Best regards.


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  07-24-2009, 6:06 AM 190141 in reply to 180437

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Hello,

    I tried today to use Aspose.Words in my (migrated) Azure-application, but I've got also this Memory Exception by executing the Save-method (in System.drawing.graphics).

    Please help!

     
  •  07-24-2009, 6:32 AM 190146 in reply to 190141

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Hello!

     

    Thank you for reporting this.

     

    Please be more specific in what action produced the exception. Are you also saving the document in PDF format? Please attach the source document and show the code fragment that manipulates the document using Aspose.Words.

     

    Regards,
    Viktor Sazhaev
    Software Engineer, Aspose Auckland Team
     
  •  07-24-2009, 8:03 AM 190178 in reply to 190146

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Attachment: Present (inaccessible)

    Thank you for the fast reply.

    I made a testproject with one webform and one button.

    By pressing this button, the next commands will be executed:

    Document theDoc = new Document();
    theDoc.Save("Test.pdf", SaveFormat.Pdf, SaveType.OpenInBrowser, Response);

    The error is fired in line 2.

    I've attachted the whole project.

     

    Kind regards,

    Marcel

     
  •  07-24-2009, 10:30 AM 190229 in reply to 190178

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Hello Marcel!

     

    Wow, I’m working with Visual Studio 2005. Not a problem – already have recreated the project and got it run J

     

    I cannot reproduce this on Windows XP. Let’s assume here’s really the same issue that David reported at the top of the thread. Would you please try calling Document.PageCount to ensure? I have no Windows Azure within easy reach. Document.PageCount should produce the exception even when called on an empty document. If you reproduce, please also post the stack trace here.

     

    Thank you in advance.

     

    Regards,
    Viktor Sazhaev
    Software Engineer, Aspose Auckland Team
     
  •  07-24-2009, 12:40 PM 190266 in reply to 190229

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    I'm working with VS2008 with the Azure Toolkit July 2009 CTP.

    When I run this project as an usual web-application, it runs good.
    When I run this as an Azure application, the error comes up.

    So, the only manner to raise this exception is to run this project as an Azure-application within VS 2008


    Regards,
    Marcel



    Stacktrace:

    Serverfout in toepassing /.

    Onvoldoende geheugen.

    Beschrijving: Er is een onverwerkte uitzondering opgetreden tijdens het uitvoeren van de huidige webaanvraag. Raadpleeg de stacktracering voor meer informatie over deze fout en de oorsprong ervan in de code.

    Details van uitzondering: System.OutOfMemoryException: Onvoldoende geheugen.

    Fout in bron:

    Regel 9:          {
    Regel 10:             Document theDoc = new Document();
    Regel 11:             theDoc.Save("Test.pdf", SaveFormat.Pdf, SaveType.OpenInBrowser, Response);
    Regel 12:         }
    Regel 13:     }

    Bronbestand: D:\download\WebApplicationAspose\WebApplicationAspose\WebApplicationTest\Default.aspx.cs    Regel: 11

    Stacktracering:

    [OutOfMemoryException: Onvoldoende geheugen.]
       System.Drawing.Graphics.FromHwndInternal(IntPtr hwnd) +1059341
       System.Drawing.Graphics.FromHwnd(IntPtr hwnd) +60
       㠑.㦸.get_㧹() +18
       㠑.㧉.ई(String ޗ, Font ऎ) +537
       㠑.ᝍ.get_ᖎ() +76
       㠑.ᝍ.get_޳() +25
       㠑.㫙.㫭(㪾 ℀) +91
       㠑.㫙.㫞(㪾 ℀) +29
       㠑.㫙.㫝(㪾 ℀) +61
       㠑.㻽.㻿() +1388
       㠑.㪾.㡱(Int32 㡲) +52
       㠑.㼫.㼴(㡧 Ꮇ) +257
       㠑.㼫.㼬(㵽 ᐧ, 㡧 Ꮇ) +39
       㠑.㼫.㡱(㵽 ᐧ) +57
       㠑.㼖.㼙(㵽 ⴲ, 㼣 㼚) +22
       㠑.㼖.㼗(㭂 㥠, 㥋 ᾘ) +141
       㠑.㼓.㡗(㥋 㠍) +62
       㠑.㥋.㡗() +25
       㠑.㥩.㡗() +54
       ៪.Ӟ.㠊(Document ೰, ӟ ⎉) +222
       Aspose.Words.Document.UpdatePageLayout() +13
       Aspose.Words.Document.get_Ӟ() +19
       Aspose.Words.Document.ԃ(Stream Ӽ, String Ӻ, SaveFormat Ԅ) +36
       Aspose.Words.Document.Save(Stream stream, SaveFormat saveFormat) +18
       Aspose.Words.Document.Save(String fileName, SaveFormat fileFormat, SaveType saveType, HttpResponse response) +474
       WebApplicationTest._Default.Button1_Click(Object sender, EventArgs e) in D:\download\WebApplicationAspose\WebApplicationAspose\WebApplicationTest\Default.aspx.cs:11
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    


    Versiegegevens: Microsoft .NET Framework Versie:2.0.50727.4013; ASP.NET Versie:2.0.50727.3074

     
  •  07-24-2009, 1:12 PM 190275 in reply to 190266

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    Thank you. This is the same error. We’ll notify you when it is fixed.

     

    Best regards,
    Viktor Sazhaev
    Software Engineer, Aspose Auckland Team
     
  •  08-15-2009, 8:35 PM 193404 in reply to 190275

    Re: Aspose.Words.Document PageCount Out Of Memory Exception and PDF SaveToPdf

    To all who have problems with Aspose.Words on Azure:

    1. Do you use the "Windows Azure" part of the Azure Services Platform?
    2. Do you actually upload your application to Windows Azure and it fails there, in the cloud?
    3. Do you need to register and get an invitation from Microsoft to use Windows Azure?

    I register and apply for invitiation several times but I have never received one. Maybe someone can temporarily give me access to their Windows Azure account so I can try upload an application with Aspose.Words there and fix it once and for all.

    You can send me a private message using this forum to contact me.


    Roman Korchagin
    Aspose.Words Team Leader
    Aspose Auckland Team
     
Page 1 of 2 (30 items)   1 2 Next >
View as RSS news feed in XML