Professional Web Applications Themes

Problem Saving PDF to Tiff using JSObject - Adobe Acrobat SDK

I am not able to save PDF to tiff using JS object I am using Adobe Acrobat SDK 7.0.5 . Here is the code snippet in VB: ------------------------------------- Module Module1 Sub Main() Const SampleFilePath As String = "C:\test\sample.pdf" Dim jsObj As Object Dim docObj As Object docObj = CreateObject("AcroExch.PDDoc") docObj.Open(SampleFilePath) Dim str As String jsObj = docObj.GetJSObject() jsObj.saveAs("C:\test\sample_2.tif", "com.adobe.acrobat.tif") docObj.Close() End Sub End Module -------------------------------------- It does create a single tif file but it gives a error of invalid format while opening. Please advice whether I am calling in the right manner. Is there any other API in the SDK ...

  1. #1

    Default Problem Saving PDF to Tiff using JSObject

    I am not able to save PDF to tiff using JS object
    I am using Adobe Acrobat SDK 7.0.5 . Here is the code snippet in VB:
    -------------------------------------
    Module Module1
    Sub Main()
    Const SampleFilePath As String = "C:\\test\\sample.pdf"
    Dim jsObj As Object
    Dim docObj As Object
    docObj = CreateObject("AcroExch.PDDoc")

    docObj.Open(SampleFilePath)
    Dim str As String
    jsObj = docObj.GetJSObject()
    jsObj.saveAs("C:\\test\\sample_2.tif", "com.adobe.acrobat.tif")
    docObj.Close()
    End Sub
    End Module
    --------------------------------------

    It does create a single tif file but it gives a error of invalid format while opening.
    Please advice whether I am calling in the right manner.

    Is there any other API in the SDK to achieve this?

    Thanks in advance
    Samir_Raut@adobeforums.com Guest

  2. #2

    Default Re: Problem Saving PDF to Tiff using JSObject

    What program gives an "invalid file format" message? What is the
    start of the file (first few bytes)?

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

  3. #3

    Default Re: Problem Saving PDF to Tiff using JSObject

    The programs which gives "invalid format" are Imaging, Imaging Preview , mspaint .

    Here are the first few bytes of the generated tif after saving a PDF
    -----------------------------
    %PDF-1.4
    %
    1 0 obj
    << /MediaBox [ 0 0 2528 4216 ] /Type /Page /Contents [ 56 0 R ] /Resources 57 0 R /Parent 59 0 R
    > endobj
    2 0 obj
    0 obj
    << /MediaBox [ 0 0 2512 4212 ] /Type /Page /Contents [ 86 0 R ] /Resources
    87 0 R /Parent 85 0 R /Annots 137 0 R > endobj
    11 0 obj
    -------------------------------------------------------

    Samir_Raut@adobeforums.com Guest

  4. #4

    Default Re: Problem Saving PDF to Tiff using JSObject

    >The programs which gives "invalid format" are Imaging, Imaging Preview , mspaint .

    Pretty comprehensive.
    >
    >Here are the first few bytes of the generated tif after saving a PDF
    >-----------------------------
    >%PDF-1.4
    Ok, the problem is clear. This is a PDF file -not- a TIFF file. It
    seems that your request to choose a format did not succeed, so it was
    saved in the default format (PDF). I cannot say why, but that is the
    starting point.

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

  5. #5

    Default Re: Problem Saving PDF to Tiff using JSObject

    Thanks a lot for your inputs.

    I have Acrobat writer 5.0. And I guess SDK (Ver 7.0.5)internally uses Acrobat writer. So are there any issues because of this?
    Samir_Raut@adobeforums.com Guest

  6. #6

    Default Re: Problem Saving PDF to Tiff using JSObject

    >I have Acrobat writer 5.0.

    It was just called Acrobat; now it is Acrobat Standard or Acrobat
    Professional.
    >And I guess SDK (Ver 7.0.5)
    To automate Acrobat 5, the Acrobat 5 SDK is best. However, this is
    discontinued. But for JavaScript, the doentation is pretty good,
    and tells you which versions of Acrobat introduced each method, even
    each parameter. Take a look, for some bad news...

    Aandi Inston
    Aandi_Inston@adobeforums.com Guest

  7. #7

    Default Re: Problem Saving PDF to Tiff using JSObject

    I could save the PDF as tif after installing Acrobat 7.0.
    I am having a PDF which is having embedded color images. When I try to save this PDF to Monochrome tiff, the palleting is not happening as it was in Acrobat 5.0. Is there any setting by which I can control the downsampling of the colours?? :)
    What I mean to say is, I wanna convert colour range 0-255 to two colours, i.e. 0 and 1.
    Is there any tolerence setting which will allow me to control the paletting?
    Samir_Raut@adobeforums.com Guest

Similar Threads

  1. using JSObject
    By B.SashiKala@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 0
    Last Post: October 3rd, 12:56 PM
  2. Freehand MX Tiff Resolution Problem
    By James Scott 2-12 Label Co. in forum Macromedia Freehand
    Replies: 0
    Last Post: August 28th, 04:40 PM
  3. tiff problem
    By ed_norton in forum Macromedia Fireworks
    Replies: 0
    Last Post: July 23rd, 08:43 PM
  4. Tiff or Jpg when saving to print?
    By Donna Swisher in forum Photography
    Replies: 17
    Last Post: July 13th, 06:56 PM
  5. Problem saving tiff file as jpg
    By Clare Parker in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 2
    Last Post: July 4th, 04:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139