Solved

Unable  to create new object

Posted on 2016-11-30
9
54 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 20

Expert Comment

by:darbid73
ID: 41907401
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 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 41907405
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
ID: 41907430
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41907443
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
 
LVL 1

Author Comment

by:HLRosenberger
ID: 41907458
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 70

Expert Comment

by:Éric Moreau
ID: 41907471
>>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
ID: 41907567
ok.  thanks.  I still have my original issue to address.   I have a post on Aspose forum.
0
 
LVL 1

Author Comment

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

Author Closing Comment

by:HLRosenberger
ID: 41909049
Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 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