Quantcast
Channel: Adobe Community : All Content - Acrobat SDK
Viewing all 2571 articles
Browse latest View live

stream object with reference to its length

$
0
0

Hi,

 

I have the following pdf file and I cannot see page 1 in Adobe Acrobat Reader. I can see it correctly in any other pdf reader.

I need to create a stream with reference to its length (see object 100 and 200) but I could make it work. I followed the pdf spec (page 65) but it's not working.

in page 2, where the length not a reference object, everything is fine.

 

Please help.

 

%PDF-1.5

1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj

2 0 obj << /Type /Pages /MediaBox [0 0 595 842] /CropBox [0 0 595 842] /Resources 3 0 R /Kids [ 010 0 R 011 0 R ] /Count 2 >> endobj

3 0 obj << /Type /Resources /Font << /FH 4 0 R /FHB 5 0 R >> >> endobj

4 0 obj << /Type /Font /Subtype /Type1 /Name /FH /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj

5 0 obj << /Type /Font /Subtype /Type1 /Name /FHB /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj

6 0 obj << /Length 205 >> stream

0.5 0.5 0.5 rg BT /FHB 14 Tf 55 810 Td(xxx) Tj ET BT 55 795 Td(www.xxx.com) Tj ET BT 421 810 Td(yyy) Tj ET BT 421 795 Td(01/01/2015 12:00:04) Tj ET BT /FH 12 Tf 295 30 Td (/1  ) Tj ET 55 790 m 540 790 l S

endstream >> endobj

10 0 obj << /Type /Page /Parent 2 0 R /Contents [6 0 R 200 0 R 100 0 R ] >> endobj

11 0 obj << /Type /Page /Parent 2 0 R /Contents [6 0 R 101 0 R ] >> endobj

100 0 obj << /Length 200 0 R >> stream

BT /FHB 14 Tf 235 750 Td(Page 1)Tj ET

endstream >> endobj

200 0 obj

37

endobj

101 0 obj <</Length 37 >> stream

BT /FHB 14 Tf 235 750 Td(Page 2)Tj ET

endstream >> endobj

xref

0 12

0000000000 65535 f

0000000014 00000 n

0000000064 00000 n

0000000198 00000 n

0000000270 00000 n

0000000378 00000 n

0000000492 00000 n

0000000753 00000 n

0000000837 00000 n

0000000913 00000 n

0000001012 00000 n

0000001035 00000 n

trailer

<</Size 12/Root 1 0 R>>

startxref

1381

%%EOF


How to merge multiple pages into one page?

$
0
0

Hi,

I need to develop a plug-in to merge multiple pages into one page using SDK.

1)create a blank Document;

2)create a blank page with desired size;

3)copy content from page 1 to the blank page with a position;

4)copy content from page 2 to the blank page with another position;

5)save and close the document.

 

Any idea about step 3) and step 4)? Thank you.

TimeStamp to PDF

$
0
0

Hello,

I have problem with insert timestamp to PDF.

On line Array.Copy(pk, 0, outc, 0, pk.Length); is error because outc.Length = 4096, but pk.Length = 7541. Metod DejCasoveRazitko work correctly.

 

P.S. Sorry, my English is bad

 

private const String ID_TIME_STAMP_TOKEN = "1.2.840.113549.1.9.16.2.14"; // RFC 3161 id-aa-timeStampToken

 

        public void PodepisPdfCer(string SouborPDF, string OtiskCertifikatu)

        {

            //http://www.dotnetportal.cz/blogy/15/Null-Reference-Exception/5250/Digitalni-podepisovani-P DF-souboru-v-C-cast-2

 

            //Get certificate

            //Open the currently logged-in user certificate store

            var store = new System.Security.Cryptography.X509Certificates.X509Store(System.Security.Cryptography.X509 Certificates.StoreName.My, System.Security.Cryptography.X509Certificates.StoreLocation.CurrentUser);

            store.Open(System.Security.Cryptography.X509Certificates.OpenFlags.ReadOnly);

 

            string thumbprint = OtiskCertifikatu.Replace(" ", "").ToUpperInvariant();

            if (thumbprint[0] == 8206)

            {

                thumbprint = thumbprint.Substring(1);

            }

 

            //Select a certificate from the certificate store

            var certs = store.Certificates.Find(System.Security.Cryptography.X509Certificates.X509FindType.FindBy Thumbprint, thumbprint, true);

            store.Close();

 

            //Verify that a certificate exists

            if (certs.Count == 0)

            {

                MessageBox.Show("Nelze najít určený certifikát v Current user certificate store!", "Sign PDF", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                return;

            }

 

            //Open Pdf document

            byte[] pdfData = File.ReadAllBytes(SouborPDF);

 

            //Sign the PDF document

            using (MemoryStream stream = new MemoryStream())

            {

                var reader = new PdfReader(pdfData);

                var stp = PdfStamper.CreateSignature(reader, stream, '\0');

                var sap = stp.SignatureAppearance;

 

                //Protect certain features of the document

                stp.SetEncryption(null,

                    Guid.NewGuid().ToByteArray(), //random password

                    PdfWriter.ALLOW_PRINTING | PdfWriter.ALLOW_COPY | PdfWriter.ALLOW_SCREENREADERS,

                    PdfWriter.ENCRYPTION_AES_256);

 

                //Get certificate chain

                var cp = new Org.BouncyCastle.X509.X509CertificateParser();

                var certChain = new Org.BouncyCastle.X509.X509Certificate[] { cp.ReadCertificate(certs[0].RawData) };

 

                sap.SetCrypto(null, certChain, null, PdfSignatureAppearance.WINCER_SIGNED);

 

                //Set signature appearance

                BaseFont helvetica = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1250, BaseFont.EMBEDDED);

                iTextSharp.text.Font font = new iTextSharp.text.Font(helvetica, 12, iTextSharp.text.Font.NORMAL);

                sap.Layer2Font = font;

                //sap.SetVisibleSignature(new iTextSharp.text.Rectangle(415, 100, 585, 40), 1, null);

 

                var dic = new PdfSignature(PdfName.ADOBE_PPKMS, PdfName.ADBE_PKCS7_SHA1);

                //Set some stuff in the signature dictionary.

                dic.Date = new PdfDate(sap.SignDate);

                dic.Name = certs[0].Subject;    //Certificate name

                if (sap.Reason != null)

                {

                    dic.Reason = sap.Reason;

                }

                if (sap.Location != null)

                {

                    dic.Location = sap.Location;

                }

 

                //Set the crypto dictionary

                sap.CryptoDictionary = dic;

 

                //Set the size of the certificates and signature.

                int csize = 4096; //Size of the signature - 4K

 

                //Reserve some space for certs and signatures

                var reservedSpace = new Dictionary<PdfName, int>();

                reservedSpace[PdfName.CONTENTS] = csize * 2 + 2; //*2 because binary data is stored as hex strings. +2 for end of field

                sap.PreClose(reservedSpace);    //Actually reserve it

 

                //Build the signature

                System.Security.Cryptography.HashAlgorithm sha = new System.Security.Cryptography.SHA256CryptoServiceProvider();

 

                var sapStream = sap.GetRangeStream();

                int read = 0;

                byte[] buff = new byte[8192];

                while ((read = sapStream.Read(buff, 0, 8192)) > 0)

                {

                    sha.TransformBlock(buff, 0, read, buff, 0);

                }

                sha.TransformFinalBlock(buff, 0, 0);

 

                //Place message in a ContentInfo object. This is required to build a SignedCms object.

                System.Security.Cryptography.Pkcs.ContentInfo contentInfo = new System.Security.Cryptography.Pkcs.ContentInfo(sha.Hash);

 

                //Instantiate SignedCms object with the ContentInfo above.

                //Has default SubjectIdentifierType IssuerAndSerialNumber.

                System.Security.Cryptography.Pkcs.SignedCms signedCms = new System.Security.Cryptography.Pkcs.SignedCms(contentInfo, false);

 

                //Formulate a CmsSigner object for the signer.

                System.Security.Cryptography.Pkcs.CmsSigner cmsSigner = new System.Security.Cryptography.Pkcs.CmsSigner(certs[0]);  //First cert in the chain is the signer cert

 

                //Do the whole certificate chain. This way intermediate certificates get sent across as well.

                cmsSigner.IncludeOption = System.Security.Cryptography.X509Certificates.X509IncludeOption.ExcludeRoot;

 

                //Časové razítko z TSA

                if (!String.IsNullOrEmpty(textBox_ServerCasovehoRazitka.Text.Trim()))

                {

                    try

                    {

                        System.Security.Cryptography.AsnEncodedData timeData = new System.Security.Cryptography.Pkcs.Pkcs9AttributeObject(ID_TIME_STAMP_TOKEN,

                                                                                                                                           DejCasoveRazitko(stream.GetBuffer(), textBox_ServerCasovehoRazitka.Text)

                                                                                                                                          );

                        cmsSigner.UnsignedAttributes.Add(timeData);

                    }

                    catch (Exception e)

                    {

                        MessageBox.Show("Chyba TSA!\n" + e.Message);

                    }

                }

 

                //Sign the CMS/PKCS #7 message. The second argument is needed to ask for the pin.

                signedCms.ComputeSignature(cmsSigner, false);

 

                //Encode the CMS/PKCS #7 message.

                byte[] pk = signedCms.Encode();

 

                //Put the certs and signature into the reserved buffer

                byte[] outc = new byte[csize];

                Array.Copy(pk, 0, outc, 0, pk.Length);

 

                //Put the reserved buffer into the reserved space

                PdfDictionary certificateDictionary = new PdfDictionary();

                //certificateDictionary.Put(PdfName.CONTENTS, new PdfString(outc).SetHexWriting(true));

 

                //Write the signature

                sap.Close(certificateDictionary);

 

                //Close the stamper and save it

                stp.Close();

 

                reader.Close();

 

                byte[] signedData = stream.GetBuffer();

                File.WriteAllBytes(SouborPDF, signedData);

            }

        }

 

        static protected byte[] DejCasoveRazitko(byte[] PDF, string ServerTSA)

        {

            System.Security.Cryptography.SHA256Managed hashString = new System.Security.Cryptography.SHA256Managed();

            string hex = "";

 

            var hashValue = hashString.ComputeHash(PDF);

            foreach (byte x in hashValue)

            {

                hex += String.Format("{0:x2}", x);

            }

 

            // VSTUPEM je hash dokumentu, pro který se razítko vyžaduje

            NotservisTSA.GetTimeStampRequest Request = new NotservisTSA.GetTimeStampRequest(new NotservisTSA.GetTimeStampRequestBody(hex, 0));

 

            NotservisTSA.Print2PDF_WebServiceSoap Soap = new NotservisTSA.Print2PDF_WebServiceSoapClient();

 

            ((NotservisTSA.Print2PDF_WebServiceSoapClient)Soap).Endpoint.Address = new System.ServiceModel.EndpointAddress(new Uri(ServerTSA + "/Default.asmx"));

 

            PodepsaniPDF.NotservisTSA.GetTimeStampResponse Response = Soap.GetTimeStamp(Request);

           

            // VÝSTUPEM je zakódované časové razítko (GetTimeStampResult - BASE-64 v kódované struktuře TimeStampResp, viz RFC 3161) a návratová hodnota s případným popisem chyby.

            byte[] responseBytes = Encoding.ASCII.GetBytes(Response.Body.GetTimeStampResult);

 

            if(!String.IsNullOrEmpty(Response.Body.Error))

                MessageBox.Show(Response.Body.Error, "Chyba", MessageBoxButtons.OK, MessageBoxIcon.Error);

 

            string base64String = Encoding.UTF8.GetString(responseBytes, 0, responseBytes.Length);

            return Convert.FromBase64String(base64String);

        }

unable to open pdfs in sample plugin

Problem with selecting printer

$
0
0

What is the best solution to print file .pdf  from desktop application created in Visual Studio 2015(c#)?

I want to select printer from comboBox before printing.

 

Is possible using some libraries?

Form example axAcoPDF.dll

 

Thanx for help!!!

 

Thomas

Problem with unintentionally exiting full screen mode on Microsoft Surface Pro

$
0
0

I have a .pdf file that incorporates multiple javascript-based buttons. This document must be displayed in full screen mode on a Microsoft Surface Pro (users will a combination of the Pro 2, Pro 3, and Pro 4).

 

The issue I have is with how Acrobat full screen mode behaves on a Surface Pro:

 

Whenever a user uses the touchscreen to interact with the .pdf dcoument, then clicking anywhere *outside* of any of the interactive buttons has the effect of exiting full screen mode and bringing up the "restore" view of the .pdf document.

 

This only occurs with the touchscreen specifically, mouse clicks do not have the same effect.

 

I need to disable this behavior, so that clicking on the .pdf outside of any specific button will not exit full screen mode.

 

 

I assume that this is a problem that likely has to be addressed through a particular setting on the Surface itself (although I haven't been able to find which one)...but just in case, is anyone aware of a solution to this issue using the Acrobat settings or preferences?

 

Disabling/unchecking the "Escape button exits full screen" checkbox in Acrobat preferences does not solve the problem.

change pdf security

$
0
0

We currently convert PDF to text (using VB) parse and then import to QuickBooks with the QuickBooks SDK, one of the suppliers now has security on the PDF so we cannot convert or screen copy text.  We can open the PDF with acrobat remove security and then we can convert to text. Is they a way to do this with the Acrobat SDK.

get rect value of articlebox added in PDF javascript

$
0
0

Hi All,

 

Please help to get the rect(like x, y and width, height) values of article box use in PDF using acrobat SDK or API.


Incorrect PDEObject Type Exception.

$
0
0

In my Adobe Acrobat Plug-In on some very specific data sheets, an exception is thrown  "Incorrect PDEObject Type'.    This occurs at the execution of the PDEContentGetewtNumElems( pdeContent ) statement.  Not sure why I would have an Incorrect PDEObject Type only in very specific files. 

 

 

---------------------------------------------------------

 

static void EnumeratePDEElems(PDEElement);

static int outputLimit;

static void PDEPathExplorerSnip( int pageNum )

{

 

    AVDoc CurrentAVDoc = AVAppGetActiveDoc();  

   if (!CurrentAVDoc ) return;

 

  AVPageView CurrentAVPageView = AVDocGetPageView(CurrentAVDoc);

  PDDoc pDoc = AVDocGetPDDoc( CurrentAVDoc );

 

  PDPage pdPage = PDDocAcquirePage(pDoc, pageNum  );

  if (pdPage == NULL) return;

 

  PDEContent pdeContent = PDPageAcquirePDEContent(pdPage, 0);

  PDEElement pdeElem = NULL;

 

  DURING

       int cnt = 0;

       ASInt32 numElems = PDEContentGetNumElems(pdeContent);

 

      for (int i=0; i<numElems; i++)

     {

          pdeElem = PDEContentGetElem(pdeContent, i);

          EnumeratePDEElems(pdeElem);

         cnt++;

   }

 

  HANDLER

       DPageReleasePDEContent(pdPage, 0);

       char buf[256];

       ASInt32 err = ERRORCODE;

       ASGetErrorString(err, buf, 256);

       AVAlertNote(buf);

  END_HANDLER

       outputLimit = 0;

       PDPageReleasePDEContent(pdPage, 0);

}

AcroExch.App(.Open) do not work on Win8 & Win10

$
0
0

AcroExch.App do not work on Win8 & Win10

Please solve... Why? What's the problem...?

 

My error code is a part of VB Automatic PDF print code, I'm working on Excel VB macro

The code is General example on the web.

This code works very well on win7.

But do not work on win8 & win10

Already Checked "Adobe acrobat 10.0 Type Library" 

But cannot work  AVDoc.Open filename, ""

At the line    AVDoc.Open filename, ""

Acrobat.exe is running (Can see with Task manager)

But works or shows nothing...

When Close Acrobat.exe by "Task manager", VB shows '-2147023170 (800706be) runtime error'.

 

<Versions for Ref.>

OS = win10 (using BitLocker)

Acrobat = Acrobat XI standard

MS Office = Excel2016 (with Micosoft Visual Basic for Application 7.1)

 

<My code is ...>

 

Sub file2PDF()

Dim Shift_row, Shift_Col As Integer
Dim i, RR, CC, aaa As Integer
Dim filename As String

Dim AcroApp As Acrobat.AcroApp
Dim AVDoc As Acrobat.AcroAVDoc
Dim PDDoc As Acrobat.AcroPDDoc
Dim IsSuccess As Boolean

   Set AcroApp = CreateObject("AcroExch.App")
   Set AVDoc = CreateObject("AcroExch.AVDoc")

filename = "C:\xxx\aaa.xlsx"               '<=== No problem until here
   
    AVDoc.Open filename, ""                  '<===Always Stop at this line

 

    Set AVDoc = AcroApp.GetActiveDoc

    If AVDoc.IsValid Then
        Set PDDoc = AVDoc.GetPDDoc
        ' Fill in pdf properties.
        PDDoc.SetInfo "Title", "My Title"
        PDDoc.SetInfo "Author", "The Author"
        PDDoc.SetInfo "Subject", "The Subject"
        PDDoc.SetInfo "Keywords", "Keywords"
         aaa = 2
        If PDDoc.Save(aaa, F_loc) <> True Then
            MsgBox "Failed to save " & filename
        End If
      PDDoc.Close
    End If
   
    AVDoc.Close True
    AcroApp.Exit
           
    'Cleanup
    Set PDDoc = Nothing
    Set AVDoc = Nothing
    Set AcroApp = Nothing

End Sub

 

 

 

Can I programming as VB or C using the PaperCapture API in Acrobat?

$
0
0

Hi,

 

I am interested in programming.

So I will try to develop utilizing OCR function of Acrobat.

 

https://forums.adobe.com/thread/676594

After checking the above forums, Itwas impossible in VB and C # in a comment on the forum.

 

Questions

1. Can I programming as VB or C using the PaperCapture API in Acrobat?

(Only impossible C# or include All C Language ??)

 

2. Does exist an example or manual available reference when programming?

 

 

I need a help.

 

Thank you.

How do you stop Microsoft edge converting pdf to dat?

$
0
0

Microsoft updated my computer yesterday.  Now, when I email a pdf document, the recipient is receiving it in a .dat format, having been converted by Microsoft Edge.  I'm using Outlook, sending in HTML format, and have checked the properties on the pdf file I'm sending to open with Acrobat.

Thanks for any help.

Walter

How version need for use AcroExch.AVDoc

$
0
0

How version need for use AcroExch.AVDoc

Acrobat DC crashes immediately as you click an icon of a tool

$
0
0

Hello. I see a very starnge crash. I have some my plugins in Acrobat DC on OS X. On mostly systems everything is OK. But on two machines with El Capitan one of my plugin crashes when you click an icon in list of tools.

 

As I see in dump crash apeears not in my plugin's function:

 

```

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread

0   com.adobe.Acrobat.framework       0x00000001080cf993 0x105fe3000 + 34523539

1 com.adobe.Acrobat.framework       0x0000000106d889f6 0x105fe3000 + 14309878

2 com.adobe.Acrobat.framework       0x00000001060fb7e7 0x105fe3000 + 1148903

3 com.adobe.Acrobat.framework       0x00000001060fafc8 0x105fe3000 + 1146824

4 com.adobe.Acrobat.framework       0x0000000106046d4c 0x105fe3000 + 408908

5   com.adobe.Acrobat.framework       0x00000001060468ea 0x105fe3000 + 407786

6 com.adobe.Acrobat.framework       0x0000000106048896 0x105fe3000 + 415894

7 com.adobe.Acrobat.framework       0x00000001060486f2 0x105fe3000 + 415474

8 com.adobe.Acrobat.framework       0x0000000106046f00 0x105fe3000 + 409344

9 com.adobe.Acrobat.framework       0x00000001060468ea 0x105fe3000 + 407786

10 com.adobe.Acrobat.framework      0x0000000106048896 0x105fe3000 + 415894

11 com.adobe.Acrobat.framework      0x00000001060486f2 0x105fe3000 + 415474

12 com.adobe.Acrobat.framework      0x0000000106046f00 0x105fe3000 + 409344

13 com.adobe.Acrobat.framework      0x00000001060468ea 0x105fe3000 + 407786

14 com.adobe.Acrobat.framework      0x00000001060465c8 0x105fe3000 + 406984

15  com.adobe.Acrobat.framework      0x000000010699bae3 0x105fe3000 + 10193635

16 com.adobe.Acrobat.framework      0x0000000106045f3b 0x105fe3000 + 405307

17  com.apple.AppKit                   0x00007fff9167dcd2 -[NSView _drawRect:clip:] + 3626

18  com.apple.AppKit                   0x00007fff916d5cad -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1873

19  com.apple.AppKit                   0x00007fff916d608a -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2862

20  com.apple.AppKit                   0x00007fff916d608a -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2862

21  com.apple.AppKit                   0x00007fff916d608a -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2862

22  com.apple.AppKit                   0x00007fff9167b3fb -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topVi ew:] + 838

23  com.apple.AppKit                   0x00007fff9167c785 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topVi ew:] + 5840

24  com.apple.AppKit                   0x00007fff9167abe0 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topVi ew:] + 334

25  com.apple.AppKit                   0x00007fff91678feb -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 2449

26  com.apple.AppKit                   0x00007fff916743f5 -[NSView displayIfNeeded] + 1950

27  com.apple.AppKit                   0x00007fff91673c3c -[NSWindow displayIfNeeded] + 232

28 com.adobe.Acrobat.framework      0x000000010603ddb9 0x105fe3000 + 372153

29  com.apple.AppKit                   0x00007fff9173c1a4 _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints + 884

30  com.apple.Foundation                   0x00007fff97354dec __NSFireTimer + 95

31  com.apple.CoreFoundation           0x00007fff98e58b94 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20

32  com.apple.CoreFoundation           0x00007fff98e58823 __CFRunLoopDoTimer + 1075

33  com.apple.CoreFoundation           0x00007fff98e5837a __CFRunLoopDoTimers + 298

34  com.apple.CoreFoundation           0x00007fff98e4f871 __CFRunLoopRun + 1841

35  com.apple.CoreFoundation           0x00007fff98e4eed8 CFRunLoopRunSpecific + 296

36  com.apple.HIToolbox             0x00007fff9dd31935 RunCurrentEventLoopInMode + 235

37  com.apple.HIToolbox             0x00007fff9dd31677 ReceiveNextEventCommon + 184

38  com.apple.HIToolbox             0x00007fff9dd315af _BlockUntilNextEventMatchingListInModeWithFilter + 71

39  com.apple.AppKit                   0x00007fff9151bdf6 _DPSNextEvent + 1067

40  com.apple.AppKit                   0x00007fff9151b226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454

41  com.apple.AppKit                   0x00007fff9150fd80 -[NSApplication run] + 682

42 com.adobe.Acrobat.framework      0x0000000105feb201 0x105fe3000 + 33281

43 com.adobe.Acrobat.framework      0x0000000105fe9bae RunAcrobat + 246

44  com.adobe.Acrobat.Pro                  0x0000000105fdef47 main + 86

45  libdyld.dylib                    0x00007fff8d4f35ad start + 1

```

 

I also found crash with such dump in the internet:

Mac Forums

 

I have no idea why acrobat crashes. Maybe someone can help me?

Extracting signature information in VBA from a PDF file

$
0
0

Hi all,

 

I need to extract signatures information from PDF files in VBA (Mainly the signatory name and the signature date. The PDF files have several signatures inside them).

So I have got some questions :

 

- Is there a example somewhere to do such a thing?

- Will I need Acrobat Pro for that purpose? This is an important point as the code is supposed to be ran on machines where ONLY Acrobat Reader is installed.

- If the above is impossible, do you know about a command line utility that would do the thing (and that I could run from my VB code)

 

Thank you for your help

Emphyrio


AFLayoutText causes failure in creating appearance

$
0
0

In Acrobat 11 I'm using AFLayout object to create annotation appearance. I want it to have background and some text on it. Everything seems to run fine but, when I  use also method AFLayoutText as in the sample below it creates null CosObj. Without the text method works fine and the appearance is created correctly. Am I missing something?

 

Thanks

 

       

    ASFixedRect rect;

    PDAnnotGetRect(annot, &rect);

    AFLayout layout = AFLayoutNew(&rect, pdRotate0, cosDoc);

 

    // border and background

    AFPDWidgetBorderRec border;

    border.nStyle = AFPDWBSolid;

    border.nWidth = 0;

    PDColorValueRec brdrColor = { PDDeviceRGB, { fixedOne, fixedZero, fixedZero, fixedZero } };

    PDColorValueRec bkndColor = { PDDeviceRGB, { fixedOne, fixedZero, fixedZero, fixedZero } };

    AFLayoutBorder(layout, &border, &brdrColor, &bkndColor, false);

 

    // text

    TextAppearance_t ta;

    SetDefault_TextAppearanceP(&ta);

    AFLayoutText(layout, false, false, &border, &ta, "OK");

 

    // create stream cosObj

    CosObj cosN = AFLayoutCreateStream(layout);

     AFLayoutDelete(layout);

Adding a new page to exisitng PDF document

$
0
0

Hi All,

 

How to add new page(summary page) with some text in it to the merged pdf document using c#.Net.

 

Any help would be appriciated

 

 

Thanks

 

quick keys for adobe pro - deleting

$
0
0

I'm relatively new to Adobe Pro, which we use to create financial reports from other files. At one point, you could use, I think, Ctrl + Shift + D to delete out pages. I either turned off this function or it is no longer available? Can I create a quick key to delete? How can I delete with one hand and scroll with the other to improve efficiency? I'm deleting out almost a hundred pages and anything would help. Thanks.

AVPageViewDragOutNewRect element invisible page

$
0
0

I used the AVPageViewDragOutNewRect() function to draw a rectangle on the page. I know that rectangle is being drawn because I checked the values of the left, right, bottom, and top after I converted the ASDevRect to a ASFixedRect. However, the rectangle that I drew is not showing on the page. Is there a way to make the drawn rectangle visible.?

AVPageViewDragOutNewRect()

Create and manage a collection (portfolio) using VBA (on Excel)

$
0
0

Hi,

I've been lloking for days but still don't have the answer... so I ask.

 

I have an excel macro which generate 15 different PDF files. I want to merge them in one collection (portfolio) at the end o the macro. The only code which I found is the following:

Sub createPortfolio2()
Dim AcroApp As Acrobat.CAcroApp
Dim Doc As Acrobat.CAcroPDDoc
Dim jso As Object

Set AcroApp = CreateObject("AcroExch.App")
Set Doc = CreateObject("AcroExch.PDDoc")
Doc.Create
Set jso = Doc.GetJSObject

'below is the actual code which creates the portfolio ("collection" in adobe parlance)
Set Collection = jso.app.newcollection()

'to add documents to your new portfolio, use the importdataobject method, I'm 90% sure the file path has to be formatted with the adobe / marks
If Collection.importdataobject(cName:="001.pdf", cDIpath:="//IFC1.IFR.INTRA2.ADMIN.CH/Shares/Organisation/LBA-ALCG-RE/11_Monitoring-contro lling/00_SCA Controlling/Impression/001.pdf") = True Then
MsgBox "You should see your portfolio now!"
End If

Collection.saveas(“//IFC1.IFR.INTRA2.ADMIN.CH/Shares/Organisation/LBA-ALCG-RE/11_Monitorin g-controlling/00_SCA Controlling/Impression/001.pdf”)
AcroApp.Close

End Sub

 

it stops working at the line "If Collection.importdataobject" with error 448 argument cannot be found. the saveas function doesn't work neither...

 

Any help is welcome

 

PS I'm working with adobe acrobat X Pro and excel 2010

Viewing all 2571 articles
Browse latest View live


Latest Images