_HTML2PDFConverterServiceStub.java 2.79 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.html2pdf;

import com.adobe.html2pdf.*;
import org.omg.CORBA.MARSHAL;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Object;
import org.omg.CORBA.portable.*;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Properties;

public class _HTML2PDFConverterServiceStub
extends ObjectImpl
implements HTML2PDFConverterService {
    private static String[] __ids = new String[]{"IDL:com/adobe/html2pdf/HTML2PDFConverterService:1.0"};

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public void ConvertToPDF(String url, String pdfFilePath, Html2PdfSettings htmlConversionSettings, Html2PdfFontPaths fontPaths, long timeout) throws HtmlToPdfFailureException {
        InputStream $in = null;
        try {
            OutputStream $out = this._request("ConvertToPDF", true);
            $out.write_wstring(url);
            $out.write_wstring(pdfFilePath);
            Html2PdfSettingsHelper.write($out, htmlConversionSettings);
            Html2PdfFontPathsHelper.write($out, fontPaths);
            $out.write_longlong(timeout);
            $in = this._invoke($out);
            return;
        }
        catch (ApplicationException $ex) {
            $in = $ex.getInputStream();
            String _id = $ex.getId();
            if (_id.equals("IDL:com/adobe/html2pdf/HtmlToPdfFailureException:1.0")) {
                throw HtmlToPdfFailureExceptionHelper.read($in);
            }
            throw new MARSHAL(_id);
        }
        catch (RemarshalException $rm) {
            this.ConvertToPDF(url, pdfFilePath, htmlConversionSettings, fontPaths, timeout);
        }
        finally {
            this._releaseReply($in);
        }
    }

    public String[] _ids() {
        return (String[])__ids.clone();
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    private void readObject(ObjectInputStream s) throws IOException {
        String str = s.readUTF();
        String[] args = null;
        Properties props = null;
        ORB orb = ORB.init(args, props);
        try {
            Object obj = orb.string_to_object(str);
            Delegate delegate = ((ObjectImpl)obj)._get_delegate();
            this._set_delegate(delegate);
        }
        finally {
            orb.destroy();
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    private void writeObject(ObjectOutputStream s) throws IOException {
        String[] args = null;
        Properties props = null;
        ORB orb = ORB.init(args, props);
        try {
            String str = orb.object_to_string(this);
            s.writeUTF(str);
        }
        finally {
            orb.destroy();
        }
    }
}