Solved

Unable  to create new object

Posted on 2016-11-30
9
19 Views
Last Modified: 2016-12-01
Can anyone tell me what the error in the image means?   And how would I go about creating a new instance of this object?

error message
0
Comment
Question by:HLRosenberger
  • 5
  • 3
9 Comments
 
LVL 19

Expert Comment

by:darbid73
Comment Utility
The class starts with the word "Friend" but needs to start with the word "Public".

If this is your code then change it. If it is not your code their might be another way of getting to this information.
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
Comment Utility
If not mistaken, you need to use the Add method on the Pages collection:
Dim pdfPage as Aspose.Pdf.Page = YourAsposeDocumentInstance.Pages.Add()

Open in new window

0
 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
Eric  - yes this is Aspose.  And I am doing exactly what you suggest.  Here's my problem - I'm creating a 100 (or whatever) page PDF.   The single page that I'm reading in is from a Forms PDF document.   I populate the fields with data, then flatten the page.  I then add that page to the collection of pages in a new document.   That page is now flattened (no fields). But I want a new instance of the page with fields to reuse  for the next page of the new document.  I can only get a new unflattened page by using a new instance of the PDF document class, which in turn hits the disk.  This disk access makes creating a 100 page document take 10 seconds.   I want an unflattened instance of the page in memory that I can reuse - populate the fields with data and then flatten.   Know what I mean?
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
Not sure to fully follow you. But if you call the Add method twice, you should get what you want no?

Dim pdfPage1 as Aspose.Pdf.Page = YourAsposeDocumentInstance.Pages.Add()
Dim pdfPage2 as Aspose.Pdf.Page = YourAsposeDocumentInstance.Pages.Add()

Open in new window

0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
that will give me two pages - the same page twice, correct?  In between each page I need to populate the fields within that page.   Let me try this explanation -

I am going to use Adobe Acrobat to create a PDF form with multiple text fields on a single page. Now, I need to repeat this page multiple times and save the result as a multi-page PDF document, using Aspose.  So, I'm using this single page as a template, so to speak. Now say my form is for data related to a house. And then I have 100 houses in my database. I need to create a 100 page PDF document where each page is the same format, but the house-related data changes.  I need to flatten each page because if I don't, leaving those form fields on each page causes performance issues with my 100 page PDF.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
>>that will give me two pages - the same page twice, correct?  

That will give you 2 new pages.
0
 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
ok.  thanks.  I still have my original issue to address.   I have a post on Aspose forum.
0
 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
darbid73 - What's the "other" way you speak of, as this is not my code.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
Comment Utility
Thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now