Print Page | Close Window

Adding TextBox

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=197
Printed Date: 30 Apr 24 at 12:12AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Adding TextBox
Posted By: Stephen0838
Subject: Adding TextBox
Date Posted: 06 Dec 05 at 4:24PM

I am working in vc++6 and am having an issue.

What I am dooing is a batch process. The process is.
Open each PDF
Increse the size of the page by adding .5 inch to the top
Draw a black Square .5 x .5 Inches.
Write the document number in the box in White.
Save The document
Merge all Documents with MergeFast
Open the resulting Document and add a bookmark for each document added to the final PDF.

The issue affects only some PDF documents the .5 inch header is added but it is gray instead of white (Prints white) and the box and text is not added.

So far I have seen this mainly with PDF's created with Pixiel Translations.

Code of the method that is giving issues is below.

 {
CSECiSEDDLL ISED; //Custom Wrapper on methods I use from DLL
 DecryptPDF(filename);
 long  rv;
 long doclen; //length of document
 long doc1_id; //document ID
 double pageh; //pageHeight
 double pageW; //pageWidth
 long i;
 bool rotated;

 
 rv = ISED.LoadFromFile(const_cast <char *> (filename.c_str()));
 if (rv == 1)
 {
  doc1_id = ISED.SelectedDocument();
  ISED.SetMeasurementUnits(2);
  ISED.SetOrigin(origin); //2
  doclen = ISED.PageCount();
  for(i=1; i <= doclen; i++)
  {
   //select page
   ISED.SelectPage(i);
   //increase page size
   pageh = ISED.PageHeight();
   pageW = ISED.PageWidth();
   rotated = false;
   if(autorotate)
   {
    if(pageW > pageh)
    {
     ISED.RotatePage(270);
     pageh = ISED.PageHeight();
     pageW = ISED.PageWidth();
     rotated = true;
    }
   }
   
   pageh += add_to_height; //.6
   pageW += add_to_Width; //0
   ISED.SetPageDimensions(pageW, pageh);
   //addnumber
   if(boxopt.drawbox)
   {
    ISED.SetFillColor(boxopt.BoxRed, boxopt.BoxGreen, boxopt.BoxBlue);
    ISED.SetLineColor(boxopt.BoxRed, boxopt.BoxGreen, boxopt.BoxBlue);
    ISED.DrawBox(boxopt.Left, boxopt.Top, boxopt.Width, boxopt.Height, boxopt.DrawOptions);
   }
   ISED.SetTextAlign(Textopt.TextAlign);
   ISED.SetTextSize(Textopt.TextSize);
   ISED.SetTextColor(Textopt.TextRed, Textopt.TextGreen, Textopt.TextBlue);
   ISED.DrawText(Textopt.XPos, Textopt.YPos, const_cast <char *> (text.c_str()));
   if (rotated)
   {
    ISED.RotatePage(90);
   }
  }
  ISED.SaveToFile (const_cast <char *> (filename.c_str()));
 }
}




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk