Trial Version Limitations?

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
weswagner
Posts: 4
Joined: Tue Feb 03 2009

Trial Version Limitations?

Post by weswagner »

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 »

Hello

This issue is resolved in a new build of the Creator .Net that is now available on our website.

Hope that helps.
David
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
weswagner
Posts: 4
Joined: Tue Feb 03 2009

Re: Trial Version Limitations?

Post by weswagner »

The posted demo version is the new build correct? I just downloaded the demo version when I saw your post, and it says that the last modify date is October 16, 2008 and it has the same version number as the one I currently have.
Post Reply