# pdfx package gives me Option clash for package hyperref

I'm using the following package for convert a PDF to a PDF/A format

\usepackage[a-1b]{pdfx}

When I compile, I receive the following error.

"Option clash for package hyperref"

I've searched within TEX but until now I didn't find any valid solution.

I compile with Mac OS Tex in TexShop. The typeset is set as LaTex.

Edit

Here a small example of what I'm trying to achieve

\documentclass[english,lof,lot]{thesis}
\errorcontextlines=9

\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}

\usepackage{lmodern}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{caption}
\usepackage{algorithmic}
\usepackage{array}
\usepackage{amssymb}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage[figuresright]{rotating}
\usepackage{float}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PDF/A
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[a-1b]{pdfx}

// begin document here...

where thesis.cls is a document class that contains the following

\RequirePackage{ifpdf}
\ifpdf
\RequirePackage[pdfpagelabels]{hyperref}
\else
\RequirePackage{hyperref}
\fi

Since I didn't write the class, I would like to know if how is it possible to overcome the error.

When I try to compile with this configuration, the error is the following

The package hyperref has already been loaded with options: [pdfpagelabels]. There has now been an attempt to load with option [pdftex,pdfa] Adding the global options:pdfpagelabels,pdftex,pdfa to your \documentclass declaration may fix this.

-
if you type h to the prompt it should tell you which option clashed and suggest a possible workaround – David Carlisle Jan 3 at 0:05
The package pdfx already loads hyperref; if you need to set other options for this one, use \hypersetup{<options>} – egreg Jan 3 at 0:06
@DavidCarlisle Thank you. The compiler gives me: The package hyperref has already been loaded with options: [pdfpagelabels] There has now been an attempt to load with option [pdftex,latex] Adding the global options:pdfpagelabels,pdftex,pdfa to your \documentclass declaration may fix this – flexaddicted Jan 3 at 0:10
On the next line it will have said Adding the global options:... to your \documentclass declaration may fix this. add the options it says to \documentclass (this can fail but it works in most cases) – David Carlisle Jan 3 at 0:12

that should be

\RequirePackage{ifpdf}
\ifpdf \PassOptionsToPackage{pdfpagelabels}{hyperref} \fi
\RequirePackage{hyperref}
-
show 1 more comment

Following @egreg comment

The package pdfx already loads hyperref; if you need to set other options for this one, use \hypersetup{options here}

I removed this code in the class file

\RequirePackage{ifpdf}
\ifpdf
\RequirePackage[pdfpagelabels]{hyperref}
\else
\RequirePackage{hyperref}
\fi

and in .tex file I did the following

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PDF/A
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[a-1b]{pdfx}
\hypersetup{pdfpagelabels}

Now it compiles and when I open it trough Adobe, it says me that is PDF/A compliant.

I think this works since I compile through PdfLaTex, but I'm not sure. I'm not an expert on this.

If exists a better solution, let me know. I will try it and remove the mark for my answer.

P.S. @Herbert, thank you for the support.

-