Trial Version Limitations?

The PDF Creator .NET Library enables you to create secure PDF documents on the fly and to view, print and process existing PDF documents. If you have any questions about PDF Creator .Net, please post them here.
Post Reply
weswagner
Posts: 4
Joined: Tue Feb 03 2009

Trial Version Limitations?

Post by weswagner » Wed Feb 04 2009

I downloaded the trial version of this software over a week ago and believe that I have run into a somewhat major problem. My goal is to allow a user to insert multiple ".jpg" images into an existing PDF document. The images won't be inserted at the same time, so the document will need to be opened and closed multiple times. Currently, I can open a document, insert one image, and close the document just fine. When the user tries to add a second image, the document is opened, the image is inserted, and the document is closed without errors, but when I open the PDF document in Adobe Reader, the image is displayed on a blank page and all of the existing pages are erased. I would post images to try to explain better, but the PDF documents are customer bills... This is the C# code I am using to insert the image:

Code: Select all

string _imageTestOriginalDocFilePath = @"C:\Documents and Settings\wesw\Desktop\PDF Inserter Files\AmyuniTest\2009Jan01Letters_0138191_147789.pdf";
string _imageFilePath = @"C:\Documents and Settings\wesw\Desktop\PDF Inserter Files\Amyuni Test\sample-barcode.jpg";
int _pageNumber = 2;
int _xCoord = 0;
int _yCoord = 0;
int _imageHeight = 500;
int _imageWidth = 499;

                private void button2_Click(object sender, EventArgs e)
		{
			acPDFCreatorLib.Initialize();

			// Open the original PDF document from file
			FileStream origFile = new FileStream(_imageTestOriginalDocFilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.Read);
			IacDocument origDocument = new IacDocument(null);
			origDocument.Open(origFile, "");

			if (_pageNumber > origDocument.PageCount)
				_pageNumber = origDocument.PageCount;

			// Create image object & create picture object on page
			origDocument.GetPage(_pageNumber).CreateObject(IacObjectType.acObjectTypePicture, "barcode");
			// Get image object
			IacObject newObj = origDocument.ObjectByName("barcode");
			
			//Set Properties
			newObj.AttributeByName("FileName").Value = _imageFilePath;
			newObj.AttributeByName("Page").Value = _pageNumber;
			newObj.AttributeByName("Left").Value = _xCoord;
			newObj.AttributeByName("Top").Value = _yCoord;
			newObj.AttributeByName("Right").Value = _imageWidth;
			newObj.AttributeByName("Bottom").Value = _imageHeight;

                        // Refresh image and document
			newObj.Redraw();
			newObj = origDocument.ObjectByName("barcode");
			newObj.Refresh();
			origDocument.Redraw();

                        // Save document, remove references to the image object and the document, and close the filestream
			origDocument.Save(origFile, IacFileSaveOption.acFileSaveAll);
			newObj.Dispose();
			origDocument.Dispose();
			origFile.Close();

			acPDFCreatorLib.Terminate();

			Application.Exit();
		}
Is there something I'm missing or is this a limitation of the trial version?

Thanks in advance!
Wes

David
Amyuni Team
Posts: 89
Joined: Mon Dec 18 2006

Re: Trial Version Limitations?

Post by David » Tue Mar 31 2009

same issue as http://www.amyuni.com/forum/viewtopic.php?f=14&t=2506

Resolved in latest version available on our website
Amyuni Custom Development
Do you need a specific PDF solution? Are you looking for expertise that will enable you to start or complete a PDF integration project?
http://www.amyuni.com/en/company/services.php

Post Reply