Solved

Unable  to create new object

Posted on 2016-11-30
9
65 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

627 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